|
| 1 | +name: zarr-metadata |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - 'packages/zarr-metadata/**' |
| 8 | + - '.github/workflows/zarr-metadata.yml' |
| 9 | + pull_request: |
| 10 | + paths: |
| 11 | + - 'packages/zarr-metadata/**' |
| 12 | + - '.github/workflows/zarr-metadata.yml' |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +defaults: |
| 23 | + run: |
| 24 | + shell: bash |
| 25 | + working-directory: packages/zarr-metadata |
| 26 | + |
| 27 | +jobs: |
| 28 | + test: |
| 29 | + name: pytest py=${{ matrix.python-version }} |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + python-version: ['3.11', '3.12', '3.13', '3.14'] |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 37 | + with: |
| 38 | + persist-credentials: false |
| 39 | + - name: Install uv |
| 40 | + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
| 41 | + with: |
| 42 | + enable-cache: true |
| 43 | + - name: Set up Python ${{ matrix.python-version }} |
| 44 | + run: uv python install ${{ matrix.python-version }} |
| 45 | + - name: Sync test dependency group |
| 46 | + run: uv sync --group test --python ${{ matrix.python-version }} |
| 47 | + - name: Run pytest |
| 48 | + run: uv run --group test pytest tests |
| 49 | + |
| 50 | + ruff: |
| 51 | + name: ruff |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 55 | + with: |
| 56 | + persist-credentials: false |
| 57 | + - name: Install uv |
| 58 | + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
| 59 | + - name: Run ruff |
| 60 | + run: uvx ruff check . |
| 61 | + |
| 62 | + pyright: |
| 63 | + name: pyright |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 67 | + with: |
| 68 | + persist-credentials: false |
| 69 | + - name: Install uv |
| 70 | + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
| 71 | + with: |
| 72 | + enable-cache: true |
| 73 | + - name: Set up Python |
| 74 | + run: uv python install 3.11 |
| 75 | + - name: Sync test dependency group |
| 76 | + run: uv sync --group test --python 3.11 |
| 77 | + - name: Run pyright |
| 78 | + run: uv run --group test --with pyright pyright src |
| 79 | + |
| 80 | + zarr-metadata-complete: |
| 81 | + name: zarr-metadata complete |
| 82 | + needs: [test, ruff, pyright] |
| 83 | + if: always() |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Check failure |
| 87 | + if: | |
| 88 | + contains(needs.*.result, 'failure') || |
| 89 | + contains(needs.*.result, 'cancelled') |
| 90 | + run: exit 1 |
| 91 | + - name: Success |
| 92 | + run: echo Success! |
0 commit comments