Fix release. #634
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**' | |
| - '!*.md' | |
| pull_request: | |
| paths: | |
| - '**' | |
| - '!*.md' | |
| defaults: | |
| run: | |
| shell: bash | |
| concurrency: | |
| group: CI-${{ github.ref }} | |
| # Queue on all branches and tags, but only cancel overlapping PR burns. | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }} | |
| jobs: | |
| org-check: | |
| name: Check GitHub Organization | |
| if: github.repository_owner == 'a-scie' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Noop | |
| run: "true" | |
| ci: | |
| name: (${{ matrix.name }}) CI | |
| needs: org-check | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # N.B.: macos-14 is the oldest non-deprecated ARM Mac runner. | |
| include: | |
| - os: ubuntu-24.04 | |
| name: Linux x86-64 (musl) | |
| image: alpine | |
| arch: amd64 | |
| - os: ubuntu-24.04 | |
| name: Linux x86-64 (glibc) | |
| image: debian/bookworm | |
| arch: amd64 | |
| - os: ubuntu-24.04 | |
| name: Linux aarch64 (musl) | |
| image: alpine | |
| arch: arm64 | |
| - os: ubuntu-24.04 | |
| name: Linux aarch64 (glibc) | |
| image: debian/bookworm | |
| arch: arm64 | |
| - os: ubuntu-24.04 | |
| name: Linux armv7l | |
| image: debian/bookworm | |
| arch: arm/v7 | |
| - os: ubuntu-24.04 | |
| name: Linux riscv64 | |
| image: debian/trixie | |
| arch: riscv64 | |
| - os: ubuntu-24.04 | |
| name: Linux s390x | |
| image: debian/bookworm | |
| arch: s390x | |
| - os: ubuntu-24.04 | |
| name: Linux powerpc64le | |
| image: debian/bookworm | |
| arch: ppc64le | |
| - os: macos-x86_64 | |
| name: macOS x86-64 | |
| - os: macos-14 | |
| name: macOS aarch64 | |
| - os: windows-2022 | |
| name: Windows x86-64 | |
| - os: windows-11-arm | |
| name: Windows aarch64 | |
| env: | |
| FORCE_COLOR: 1 | |
| SCIENCE_AUTH_API_GITHUB_COM_BEARER: ${{ secrets.GITHUB_TOKEN }} | |
| SCIENCE_NET_TIMEOUT: 30.0 | |
| steps: | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Setup uv | |
| run: | | |
| export UV="$(which uv)" | |
| "${UV}" -V | |
| echo UV="${UV}" >> ${GITHUB_ENV} | |
| - name: Checkout Lift | |
| uses: actions/checkout@v4 | |
| - name: Ensure aarch64 Python for Windows ARM | |
| if: matrix.os == 'windows-11-arm' | |
| run: | | |
| # N.B.: uv still defaults to x86_64 / Prism emulation; so we have to force aarch64 here. | |
| UV_PYTHON_VERSION="cpython-$(cat .python-version)-windows-aarch64" | |
| "${UV}" python install ${UV_PYTHON_VERSION} | |
| echo UV_PYTHON="${UV_PYTHON_VERSION}" >> ${GITHUB_ENV} | |
| - name: Restore MyPy Cache | |
| id: restore-mypy-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: .mypy_cache | |
| # We're using a key suffix / restore-keys prefix trick here to get an updatable cache. | |
| # See: https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache | |
| key: ${{ matrix.image || format('{0}-{1}', matrix.os, runner.arch) }}-a-scie-lift-mypy-v1-${{ github.run_id }} | |
| restore-keys: ${{ matrix.image || format('{0}-{1}', matrix.os, runner.arch) }}-a-scie-lift-mypy-v1 | |
| - name: Check Formatting & Lints | |
| if: matrix.image == '' | |
| run: | | |
| "${UV}" run dev-cmd ci --skip test --timings | |
| - name: Check Formatting & Lints | |
| if: matrix.image == 'debian' && matrix.arch == 'amd64' | |
| run: | | |
| "${UV}" run dev-cmd docker -- --image ${{ matrix.image }} --arch ${{ matrix.arch }} \ | |
| ci --skip test --timings | |
| - name: Cache MyPy | |
| uses: actions/cache/save@v4 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| path: .mypy_cache | |
| key: ${{ steps.restore-mypy-cache.outputs.cache-primary-key }} | |
| - name: Configure Windows pytest short tmp dir path | |
| if: matrix.os == 'windows-2022' || matrix.os == 'windows-11-arm' | |
| run: | | |
| mkdir -p C:/tmp/gha | |
| echo PYTEST_ADDOPTS="--basetemp C:/tmp/gha/pytest" >> ${GITHUB_ENV} | |
| echo SCIE_BASE=C:/tmp/gha/nce >> ${GITHUB_ENV} | |
| - name: Unit Tests | |
| if: matrix.image == '' | |
| run: | | |
| "${UV}" run dev-cmd --timings test -- -vvs | |
| - name: Unit Tests | |
| if: matrix.image != '' | |
| run: | | |
| "${UV}" run dev-cmd docker -- --image ${{ matrix.image }} --arch ${{ matrix.arch }} \ | |
| --timings test -- -vvs | |
| - name: Build & Package | |
| if: matrix.image == '' | |
| run: | | |
| "${UV}" run dev-cmd --timings package | |
| - name: Build & Package | |
| if: matrix.image != '' | |
| run: | | |
| "${UV}" run dev-cmd docker -- --image ${{ matrix.image }} --arch ${{ matrix.arch }} \ | |
| --timings package | |
| - name: Generate Doc Site | |
| if: matrix.image == '' | |
| run: | | |
| "${UV}" run dev-cmd --timings doc linkcheck | |
| - name: Generate Doc Site | |
| if: matrix.image == 'debian' && matrix.arch == 'amd64' | |
| run: | | |
| "${UV}" run dev-cmd docker -- --image ${{ matrix.image }} --arch ${{ matrix.arch }} \ | |
| --timings doc linkcheck | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| if [[ -n "${CI_BIN_DIR}" && -d "${CI_BIN_DIR}" ]]; then | |
| rm -rf "${CI_BIN_DIR}" | |
| fi |