test #1370
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: test | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| tags-ignore: | |
| - '*' | |
| branches: ['main'] | |
| pull_request: | |
| branches: ['main'] | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - ".github/workflows/test.yml" | |
| - "pyproject.toml" | |
| - "justfile" | |
| workflow_call: | |
| workflow_dispatch: | |
| inputs: | |
| debug: | |
| description: 'Open ssh debug session.' | |
| required: true | |
| default: false | |
| type: boolean | |
| schedule: | |
| # Every Sunday at 9:00 AM Los Angeles time. | |
| # GitHub cron is UTC; 09:00 PT == 17:00 UTC (PST). | |
| - cron: '0 17 * * 0' | |
| jobs: | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| django-version: | |
| - 'dj42' # LTS April 2026 | |
| - 'dj52' # LTS April 2028 | |
| - 'dj60' # April 2027 | |
| exclude: | |
| - python-version: '3.13' | |
| django-version: 'dj42' | |
| - python-version: '3.14' | |
| django-version: 'dj42' | |
| - python-version: '3.10' | |
| django-version: 'dj60' | |
| - python-version: '3.11' | |
| django-version: 'dj60' | |
| env: | |
| COVERAGE_FILE: linux-py${{ matrix.python-version }}-${{ matrix.django-version }}.coverage | |
| ENV_FILE: linux-py${{ matrix.python-version }}-${{ matrix.django-version }} | |
| TEST_PYTHON_VERSION: ${{ matrix.python-version }} | |
| TEST_DJANGO_VERSION: ${{ matrix.django-version }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| id: sp | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Setup Just | |
| uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b | |
| with: | |
| enable-cache: false | |
| - name: Install Emacs | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| run: | | |
| sudo apt install emacs | |
| - name: Setup tmate session | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 | |
| with: | |
| detached: true | |
| timeout-minutes: 60 | |
| - name: Run Unit Tests | |
| env: | |
| TEST_PYTHON: ${{ steps.sp.outputs.python-path }} | |
| run: | | |
| just test-all -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: ${{ env.COVERAGE_FILE }} | |
| path: ${{ env.COVERAGE_FILE }} | |
| - name: Store env files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: ${{ env.ENV_FILE }} | |
| path: requirements-test*.txt | |
| test-macos: | |
| runs-on: macos-latest | |
| permissions: | |
| actions: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.12', '3.14'] | |
| django-version: | |
| - 'dj42' # LTS April 2026 | |
| - 'dj52' # LTS April 2028 | |
| - 'dj60' # April 2027 | |
| exclude: | |
| - python-version: '3.12' | |
| django-version: 'dj42' | |
| - python-version: '3.14' | |
| django-version: 'dj42' | |
| - python-version: '3.10' | |
| django-version: 'dj52' | |
| - python-version: '3.14' | |
| django-version: 'dj52' | |
| - python-version: '3.10' | |
| django-version: 'dj60' | |
| - python-version: '3.12' | |
| django-version: 'dj60' | |
| env: | |
| COVERAGE_FILE: macos-py${{ matrix.python-version }}-${{ matrix.django-version }}.coverage | |
| ENV_FILE: macos-py${{ matrix.python-version }}-${{ matrix.django-version }} | |
| TEST_PYTHON_VERSION: ${{ matrix.python-version }} | |
| TEST_DJANGO_VERSION: ${{ matrix.django-version }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| id: sp | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Setup Just | |
| uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b | |
| with: | |
| enable-cache: false | |
| - name: install-emacs-macos | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| run: | | |
| brew install emacs | |
| - name: Setup tmate session | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 | |
| with: | |
| detached: true | |
| timeout-minutes: 60 | |
| - name: Run Unit Tests | |
| env: | |
| TEST_PYTHON: ${{ steps.sp.outputs.python-path }} | |
| run: | | |
| just test-all -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: ${{ env.COVERAGE_FILE }} | |
| path: ${{ env.COVERAGE_FILE }} | |
| - name: Store env files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: ${{ env.ENV_FILE }} | |
| path: requirements-test*.txt | |
| test-windows: | |
| runs-on: windows-latest | |
| permissions: | |
| actions: write | |
| defaults: | |
| run: | |
| shell: pwsh | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.12', '3.14'] | |
| django-version: | |
| - 'dj42' # LTS April 2026 | |
| - 'dj52' # LTS April 2028 | |
| - 'dj60' # April 2027 | |
| exclude: | |
| - python-version: '3.12' | |
| django-version: 'dj42' | |
| - python-version: '3.14' | |
| django-version: 'dj42' | |
| - python-version: '3.10' | |
| django-version: 'dj52' | |
| - python-version: '3.14' | |
| django-version: 'dj52' | |
| - python-version: '3.10' | |
| django-version: 'dj60' | |
| - python-version: '3.12' | |
| django-version: 'dj60' | |
| env: | |
| COVERAGE_FILE: windows-py${{ matrix.python-version }}-${{ matrix.django-version }}.coverage | |
| ENV_FILE: windows-py${{ matrix.python-version }}-${{ matrix.django-version }} | |
| TEST_PYTHON_VERSION: ${{ matrix.python-version }} | |
| TEST_DJANGO_VERSION: ${{ matrix.django-version }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| id: sp | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Setup Just | |
| uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b | |
| with: | |
| enable-cache: false | |
| - name: install-vim-windows | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| uses: rhysd/action-setup-vim@febef33995d6649302e9d88dda81e071b68f16a7 | |
| - name: Setup tmate session | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 | |
| with: | |
| detached: true | |
| timeout-minutes: 60 | |
| - name: Run Unit Tests | |
| env: | |
| TEST_PYTHON: ${{ steps.sp.outputs.python-path }} | |
| run: | | |
| just test-all -p $env:TEST_PYTHON --group $env:TEST_DJANGO_VERSION | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: ${{ env.COVERAGE_FILE }} | |
| path: ${{ env.COVERAGE_FILE }} | |
| - name: Store env files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: ${{ env.ENV_FILE }} | |
| path: requirements-test*.txt | |
| coverage-combine: | |
| needs: [test-linux, test-macos, test-windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| id: sp | |
| with: | |
| python-version: '3.14' | |
| allow-prereleases: true | |
| - name: Setup Just | |
| uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b | |
| with: | |
| enable-cache: false | |
| - name: Setup venv | |
| env: | |
| TEST_PYTHON: ${{ steps.sp.outputs.python-path }} | |
| run: | | |
| just setup "$TEST_PYTHON" | |
| - name: Get coverage files | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| pattern: "*.coverage" | |
| merge-multiple: true | |
| - run: ls -la *.coverage | |
| - run: just coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 | |
| with: | |
| use_oidc: true | |
| files: | |
| ./coverage.xml |