|
| 1 | +name: zarr-http-server |
| 2 | + |
| 3 | +# Job steps delegate to packages/zarr-http-server/justfile, the single source |
| 4 | +# of truth for this package's verbs; CI owns only the python matrix and |
| 5 | +# caching. Keeping the commands in one place is what makes `just check` |
| 6 | +# locally mean the same thing as a green run here. |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: [main] |
| 11 | + paths: |
| 12 | + - 'packages/zarr-http-server/**' |
| 13 | + - '.github/workflows/zarr-http-server.yml' |
| 14 | + # The package resolves zarr from the repo root for its own tests, so a |
| 15 | + # core change can break it. Run this suite when core changes too. |
| 16 | + - 'src/zarr/**' |
| 17 | + pull_request: |
| 18 | + paths: |
| 19 | + - 'packages/zarr-http-server/**' |
| 20 | + - '.github/workflows/zarr-http-server.yml' |
| 21 | + # The package resolves zarr from the repo root for its own tests, so a |
| 22 | + # core change can break it. Run this suite when core changes too. |
| 23 | + - 'src/zarr/**' |
| 24 | + workflow_dispatch: |
| 25 | + |
| 26 | +permissions: |
| 27 | + contents: read |
| 28 | + |
| 29 | +concurrency: |
| 30 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 31 | + cancel-in-progress: true |
| 32 | + |
| 33 | +jobs: |
| 34 | + test: |
| 35 | + name: pytest py=${{ matrix.python-version }} |
| 36 | + runs-on: ubuntu-latest |
| 37 | + defaults: |
| 38 | + run: |
| 39 | + shell: bash |
| 40 | + working-directory: packages/zarr-http-server |
| 41 | + strategy: |
| 42 | + fail-fast: false |
| 43 | + matrix: |
| 44 | + python-version: ['3.12', '3.13', '3.14'] |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 47 | + with: |
| 48 | + persist-credentials: false |
| 49 | + - name: Install uv |
| 50 | + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
| 51 | + with: |
| 52 | + enable-cache: true |
| 53 | + - name: Set up Python ${{ matrix.python-version }} |
| 54 | + run: uv python install ${{ matrix.python-version }} |
| 55 | + - name: Install just |
| 56 | + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 |
| 57 | + - name: Sync test dependency groups |
| 58 | + # The examples group carries the deps the README examples need, so the |
| 59 | + # test that reads a served array back with a zarr client runs here |
| 60 | + # instead of silently skipping. |
| 61 | + run: uv sync --group test --group examples --python ${{ matrix.python-version }} |
| 62 | + - name: Run pytest |
| 63 | + run: just test |
| 64 | + |
| 65 | + ruff: |
| 66 | + name: ruff |
| 67 | + runs-on: ubuntu-latest |
| 68 | + defaults: |
| 69 | + run: |
| 70 | + shell: bash |
| 71 | + working-directory: packages/zarr-http-server |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 74 | + with: |
| 75 | + persist-credentials: false |
| 76 | + - name: Install uv |
| 77 | + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
| 78 | + - name: Install just |
| 79 | + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 |
| 80 | + - name: Run ruff |
| 81 | + run: just lint |
| 82 | + |
| 83 | + mypy: |
| 84 | + name: mypy |
| 85 | + runs-on: ubuntu-latest |
| 86 | + defaults: |
| 87 | + run: |
| 88 | + shell: bash |
| 89 | + working-directory: packages/zarr-http-server |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 92 | + with: |
| 93 | + persist-credentials: false |
| 94 | + - name: Install uv |
| 95 | + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
| 96 | + with: |
| 97 | + enable-cache: true |
| 98 | + - name: Set up Python |
| 99 | + run: uv python install 3.12 |
| 100 | + - name: Install just |
| 101 | + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 |
| 102 | + - name: Sync test dependency group |
| 103 | + run: uv sync --group test --python 3.12 |
| 104 | + - name: Run mypy |
| 105 | + run: just typecheck |
| 106 | + |
| 107 | + docs: |
| 108 | + name: docs |
| 109 | + runs-on: ubuntu-latest |
| 110 | + defaults: |
| 111 | + run: |
| 112 | + shell: bash |
| 113 | + working-directory: packages/zarr-http-server |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 116 | + with: |
| 117 | + persist-credentials: false |
| 118 | + - name: Install uv |
| 119 | + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 |
| 120 | + with: |
| 121 | + enable-cache: true |
| 122 | + - name: Install just |
| 123 | + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 |
| 124 | + - name: Build docs |
| 125 | + run: just docs-check |
| 126 | + |
| 127 | + zarr-http-server-complete: |
| 128 | + name: zarr-http-server complete |
| 129 | + needs: [test, ruff, mypy, docs] |
| 130 | + if: always() |
| 131 | + runs-on: ubuntu-latest |
| 132 | + steps: |
| 133 | + - name: Check failure |
| 134 | + if: | |
| 135 | + contains(needs.*.result, 'failure') || |
| 136 | + contains(needs.*.result, 'cancelled') |
| 137 | + run: exit 1 |
| 138 | + - name: Success |
| 139 | + run: echo Success! |
0 commit comments