Skip to content

Tests

Tests #1602

Workflow file for this run

name: Tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
# Allow to manually trigger through github API
workflow_dispatch:
# Triggers with push to master
push:
branches:
- main
# Triggers with push to a pr aimed at master
pull_request:
branches:
- main
schedule:
# Every day at 7AM UTC
- cron: '0 07 * * *'
env:
package-name: ConfigSpace
test-dir: test
extra-requires: "[test]" # "" for no extra_requires
# Arguments used for pytest
pytest-args: >-
--durations=20
-v
jobs:
test:
name: ${{ matrix.python-version }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash # Default to using bash on all
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install ${{ env.package-name }}
run: |
python -m pip install -e ".${{ env.extra-requires }}"
- name: Tests
run: |
pytest ${{ env.test-dir }}