refactor: enable strict-optional setting #353
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: test-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| env: | |
| PYTHONUNBUFFERED: "1" | |
| FORCE_COLOR: "1" | |
| jobs: | |
| test: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-ver: | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| os: | |
| - 'ubuntu-latest' | |
| - 'windows-latest' | |
| - 'macos-latest' | |
| exclude: | |
| - os: 'macos-latest' | |
| python-ver: '3.10' | |
| - os: 'macos-latest' | |
| python-ver: '3.11' | |
| runs-on: ${{matrix.os}} | |
| name: "Python ${{matrix.python-ver}} tests on ${{matrix.os}}" | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup Python ${{matrix.python-ver}} | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6 | |
| with: | |
| python-version: "${{matrix.python-ver}}" | |
| cache: "pip" | |
| cache-dependency-path: | | |
| **/*requirements*.txt | |
| - name: Install apt deps | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -qq -y libxml2-dev libxslt1-dev | |
| - name: Install dependencies | |
| run: | | |
| pip install -U pip wheel | |
| pip install -Ur requirements-dev.txt | |
| - name: cache pre-commit | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{runner.os}}-${{matrix.python-ver}} | |
| restore-keys: | | |
| pre-commit-${{runner.os}}- | |
| - name: Run pre-commit | |
| run: pre-commit run --all | |
| env: | |
| SKIP: yamlfmt,nitpick | |
| - name: Run yamlfmt | |
| if: runner.os != 'Windows' | |
| run: pre-commit run yamlfmt --all | |
| - name: Test with pytest | |
| run: pytest --junitxml=junit.xml | |
| env: | |
| PYTHONDEVMODE: 1 | |
| PYTHONPATH: . | |
| SQLALCHEMY_WARN_20: 1 | |
| - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | |
| with: | |
| name: build-${{ matrix.python-ver }} | |
| fail_ci_if_error: true | |
| use_oidc: true | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1 | |
| with: | |
| name: build-${{ matrix.python-ver }} | |
| fail_ci_if_error: true | |
| use_oidc: true |