Attempt to run all tests as a single job. #478
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: [push, pull_request] | |
jobs: | |
code-quality: | |
name: code-quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: repository checkout step | |
uses: actions/checkout@v4 | |
- name: python environment step | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: install pre-commit | |
run: python3 -m pip install pre-commit | |
- id: changed-files | |
name: identify modified files | |
uses: tj-actions/changed-files@v45 | |
- name: run pre-commit hooks on modified files | |
run: pre-commit run --color always --files ${{ steps.changed-files.outputs.all_changed_files }} --show-diff-on-failure | |
- name: check missing __init__ files | |
run: build_tools/fail_on_missing_init_files.sh | |
shell: bash | |
pytests: | |
name: Run pytests with and without Numba | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install Python dependencies - without Numba | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[dev] | |
python -m pip install pytest | |
- name: Test with pytest - without Numba | |
run: | | |
pytest --cov --cov-report=xml | |
- name: Install Skchange + Numba | |
run: | | |
python -m pip install .[dev,numba] | |
- name: Disable numba JIT | |
run: | | |
echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV | |
- name: Test with pytest | |
run: | | |
pytest --cov --cov-report=xml --cov-append | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
# pytests-no-numba: | |
# name: Run pytests without numba | |
# needs: pytests-numba | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Set up Python | |
# uses: actions/setup-python@v4 | |
# with: | |
# python-version: "3.9" | |
# - name: Install Python dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# python -m pip install .[dev] | |
# python -m pip install pytest | |
# - name: Test with pytest | |
# run: | | |
# pytest --cov --cov-report=xml --cov-append | |
# upload-code-cov: | |
# name: Upload-coverage-reports-to-Codecov | |
# needs: [pytests-numba, pytests-no-numba] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Check for coverage report files | |
# run: | | |
# if [ ! -f coverage.xml ]; then | |
# echo "No coverage report found!" | |
# exit 1 | |
# fi | |
# - name: Upload coverage reports to Codecov | |
# uses: codecov/codecov-action@v3 | |
# env: | |
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |