Update .gitignore #151
This file contains hidden or 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: Unit Tests & Coverage | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| #Stop redundant CI runs for superseded commits | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # needed by checkout | |
| id-token: write # required for Codecov OIDC uploads | |
| jobs: | |
| test: | |
| name: ${{ matrix.os }} • Py ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ['3.9', '3.11', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip # built‑in dependency+wheel cache | |
| cache-dependency-path: env/requirements-dev.txt | |
| #Extra cache layer: pre‑built wheels in ~/.cache/pip so can work between OS/versions | |
| - name: Cache compiled pip wheels | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('env/requirements-dev.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }} | |
| ${{ runner.os }}-pip- | |
| # Qt/OpenGL runtime (Linux only; no‑op elsewhere as stated in the action repo, mac shouldn't need it) | |
| - uses: tlambert03/setup-qt-libs@v1 | |
| - name: Install package in editable mode with test dependencies | |
| run: pip install -e .[test] | |
| - name: Configure headless Qt | |
| run: echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV #avoids xcb/display errors, according to the web | |
| - name: Run tests | |
| run: | | |
| pytest tests \ | |
| --cov=ionerdss --cov-branch \ | |
| --cov-report=xml \ | |
| --junitxml=report.xml | |
| - name: Summarise failing tests | |
| if: always() # still runs on failures | |
| uses: pmeier/[email protected] # latest tag | |
| with: | |
| path: report.xml # JUnit file(s) or glob | |
| summary: true # add high‑level counts | |
| display-options: fEX # show failed, errored, x‑passed | |
| title: "Test Results" | |
| #Junit is standard machine readable test output that can then be analyzed by various tools later, we upload as artifact to allow inspection | |
| - name: Upload JUnit report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-${{ matrix.os }}-py${{ matrix.python-version }} | |
| path: report.xml | |
| - name: Upload coverage to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| use_oidc: true #required for tokenless apparently | |
| fail_ci_if_error: true |