|
| 1 | +# Run the byte-order-sensitive tests on a big-endian host: s390x, emulated with QEMU. |
| 2 | +# Emulation makes the full suite take about 40 minutes, so this job runs only the tests |
| 3 | +# that exercise data types, codecs and metadata, and only when that code changes (plus |
| 4 | +# a weekly run to catch anything the path filter misses). |
| 5 | + |
| 6 | +name: Big-endian |
| 7 | + |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + branches: [ main ] |
| 11 | + paths: |
| 12 | + - "src/zarr/codecs/**" |
| 13 | + - "src/zarr/core/buffer/**" |
| 14 | + - "src/zarr/core/dtype/**" |
| 15 | + - "src/zarr/core/metadata/**" |
| 16 | + - "src/zarr/metadata/**" |
| 17 | + - "tests/test_codecs/**" |
| 18 | + - "tests/test_dtype/**" |
| 19 | + - "tests/test_metadata/**" |
| 20 | + - "ci/big-endian/**" |
| 21 | + - ".github/workflows/big-endian.yml" |
| 22 | + schedule: |
| 23 | + - cron: "0 3 * * 1" |
| 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 | + s390x: |
| 35 | + name: s390x (QEMU) |
| 36 | + runs-on: ubuntu-latest |
| 37 | + timeout-minutes: 90 |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 40 | + with: |
| 41 | + fetch-depth: 0 # hatch-vcs needs the tags to resolve a version |
| 42 | + persist-credentials: false |
| 43 | + - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 |
| 44 | + with: |
| 45 | + platforms: s390x |
| 46 | + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 |
| 47 | + - name: Build test image |
| 48 | + uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 |
| 49 | + with: |
| 50 | + context: ci/big-endian |
| 51 | + platforms: linux/s390x |
| 52 | + tags: zarr-big-endian |
| 53 | + load: true |
| 54 | + cache-from: type=gha,scope=big-endian |
| 55 | + cache-to: type=gha,scope=big-endian,mode=max |
| 56 | + - name: Run tests |
| 57 | + run: | |
| 58 | + docker run --rm --platform linux/s390x -v "$PWD":/src:ro zarr-big-endian bash -euc ' |
| 59 | + cp -r /src /work && cd /work |
| 60 | + pip install -q --no-deps --no-build-isolation . |
| 61 | + python -c "import sys; assert sys.byteorder == \"big\", sys.byteorder" |
| 62 | + python -m pytest -p no:cacheprovider --hypothesis-profile ci -n auto \ |
| 63 | + tests/test_dtype tests/test_dtype_registry.py \ |
| 64 | + tests/test_codecs tests/test_metadata \ |
| 65 | + tests/test_array.py tests/test_v2.py tests/test_info.py \ |
| 66 | + tests/test_pipeline_parity.py tests/test_cli/test_migrate_v3.py |
| 67 | + ' |
0 commit comments