Merge pull request #109 from bckohan/dependabot/github_actions/action… #397
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: | |
| pull_request: | |
| workflow_call: | |
| workflow_dispatch: | |
| inputs: | |
| debug: | |
| description: 'Open ssh debug session.' | |
| required: true | |
| default: false | |
| type: boolean | |
| clear_cache: | |
| description: 'Clear GitHub Actions cache.' | |
| required: true | |
| default: false | |
| type: boolean | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: write | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| env: | |
| COVERAGE_FILE: linux-py${{ matrix.python-version }}.coverage | |
| steps: | |
| - name: Clear GitHub Actions cache | |
| if: ${{ github.event.inputs.clear_cache == 'true' }} | |
| run: sudo rm -rf /opt/hostedtoolcache | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| id: sp | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Install Just | |
| uses: extractions/setup-just@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Install Dependencies | |
| run: | | |
| just setup ${{ steps.sp.outputs.python-path }} | |
| just install-docs | |
| - 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/[email protected] | |
| with: | |
| detached: true | |
| - name: Install Dependencies | |
| run: | | |
| just setup ${{ steps.sp.outputs.python-path }} | |
| just install | |
| - name: Run Unit Tests | |
| run: | | |
| just test-all | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ env.COVERAGE_FILE }} | |
| path: ${{ env.COVERAGE_FILE }} | |
| macos: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: read | |
| actions: write | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| env: | |
| COVERAGE_FILE: macos-py${{ matrix.python-version }}.coverage | |
| steps: | |
| - name: Clear GitHub Actions cache | |
| if: ${{ github.event.inputs.clear_cache == 'true' }} | |
| run: sudo rm -rf /Users/runner/hostedtoolcache | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| id: sp | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Install Just | |
| uses: extractions/setup-just@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Install Dependencies | |
| run: | | |
| just setup ${{ steps.sp.outputs.python-path }} | |
| just install-docs | |
| - 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/[email protected] | |
| with: | |
| detached: true | |
| - name: Install Dependencies | |
| run: | | |
| just setup ${{ steps.sp.outputs.python-path }} | |
| just install | |
| - name: Run Unit Tests | |
| run: | | |
| just test-all | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ env.COVERAGE_FILE }} | |
| path: ${{ env.COVERAGE_FILE }} | |
| windows: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: read | |
| actions: write | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| env: | |
| COVERAGE_FILE: windows-py${{ matrix.python-version }}.coverage | |
| steps: | |
| - name: Clear GitHub Actions cache | |
| if: ${{ github.event.inputs.clear_cache == 'true' }} | |
| run: Remove-Item -Recurse -Force C:\hostedtoolcache | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| id: sp | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Install Just | |
| uses: extractions/setup-just@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Install Dependencies | |
| run: | | |
| just setup ${{ steps.sp.outputs.python-path }} | |
| just install-docs | |
| - name: install-vim-windows | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| uses: rhysd/action-setup-vim@v1 | |
| - name: Setup tmate session | |
| if: ${{ github.event.inputs.debug == 'true' }} | |
| uses: mxschmitt/[email protected] | |
| with: | |
| detached: true | |
| - name: Install Dependencies | |
| run: | | |
| just setup ${{ steps.sp.outputs.python-path }} | |
| just install | |
| - name: Run Unit Tests | |
| run: | | |
| just test-all | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ env.COVERAGE_FILE }} | |
| path: ${{ env.COVERAGE_FILE }} | |
| coverage-combine: | |
| needs: [linux, macos, windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| id: sp | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Setup Just | |
| uses: extractions/setup-just@v3 | |
| - name: Install Release Dependencies | |
| run: | | |
| just setup ${{ steps.sp.outputs.python-path }} | |
| just install | |
| - name: Get coverage files | |
| uses: actions/download-artifact@v7 | |
| with: | |
| pattern: "*.coverage" | |
| merge-multiple: true | |
| - run: ls -la *.coverage | |
| - run: just coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage.xml |