ci: add GitHub Actions test workflow #1
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
| # CI for the ARCP Python SDK. | |
| # | |
| # Action pinning policy: | |
| # - First-party `actions/*` actions are pinned to a major tag (e.g. `@v4`). | |
| # GitHub controls these repos and major tags only move forward to | |
| # non-breaking releases. | |
| # - Third-party actions are pinned to a full commit SHA with the human- | |
| # readable version in a trailing comment. | |
| name: test | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "LICENSE" | |
| - ".gitignore" | |
| - ".editorconfig" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "LICENSE" | |
| - ".gitignore" | |
| - ".editorconfig" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: test (py${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # `requires-python = ">=3.13"` in pyproject.toml. | |
| # Floor + latest stable. 3.13 is currently both, 3.14 is the next stable. | |
| python-version: ["3.13", "3.14"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.10.0 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install project | |
| run: uv sync --frozen --all-extras --dev | |
| - name: Ruff lint | |
| run: uv run ruff check . | |
| - name: Ruff format check | |
| run: uv run ruff format --check . | |
| - name: Pyright | |
| run: uv run pyright | |
| - name: Pytest | |
| run: uv run pytest --junitxml=junit-${{ matrix.python-version }}.xml | |
| - name: Upload junit XML on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-${{ matrix.python-version }} | |
| path: junit-${{ matrix.python-version }}.xml | |
| if-no-files-found: ignore |