Overhaul CI #66
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: 'ALL: Run tests on current Python' | |
on: | |
- pull_request | |
jobs: | |
current_python_tests: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-latest', 'windows-latest'] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
cache-dependency-path: requirements-ci.txt | |
- name: Update pip | |
run: python -m pip install -U pip | |
- name: Install & report CI dependencies | |
run: | | |
python -m pip install -U --force-reinstall -r requirements-ci.txt | |
python --version | |
pip list | |
- name: Build docs | |
run: | | |
cd doc | |
make html | |
mkdir scratch | |
- name: Run tests & report source coverage | |
run: | | |
pytest --cov --testall --nonloc | |
- name: Submit to Codecov if Linux, ready status, and main/stable | |
if: ${{ matrix.os == 'ubuntu-latest' && !github.event.pull_request.draft && (github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'stable') }} | |
run: | | |
coverage xml -o coverage-service.xml | |
curl -Os https://cli.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'service'-${{ github.run_id }} -F service -f coverage-service.xml |