Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 41 additions & 73 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
define-matrix:
runs-on: "ubuntu-latest"
outputs:
test_matrix: ${{ steps.test_matrix.outputs.test_matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Define testing matrix
id: test_matrix
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "Using full matrix"
echo "test_matrix=$(jq -c . < ./.github/workflows/generated_full_matrix.json)" >> "$GITHUB_OUTPUT"
else
echo "Using PR matrix"
echo "test_matrix=$(jq -c . < ./.github/workflows/generated_pr_matrix.json)" >> "$GITHUB_OUTPUT"
fi
lint:
name: Check linting
runs-on: ubuntu-latest
Expand All @@ -59,10 +78,11 @@ jobs:

dependency:
name: Check dependency
needs: define-matrix
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include: ${{ fromJSON(needs.define-matrix.outputs.test_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -77,42 +97,20 @@ jobs:
run: python -m tox run -e dependency

build:
needs: lint
needs: [lint, define-matrix]
strategy:
matrix:
os:
- image: ubuntu-latest
id: manylinux_x86_64
- image: ubuntu-latest
id: manylinux_aarch64
- image: windows-latest
id: win_amd64
- image: windows-11-arm
id: win_arm64
- image: macos-latest
id: macosx_x86_64
- image: macos-latest
id: macosx_arm64
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- os:
image: windows-11-arm
id: win_arm64
python-version: "3.9"
- os:
image: windows-11-arm
id: win_arm64
python-version: "3.10"
name: Build ${{ matrix.os.id }}-py${{ matrix.python-version }}
runs-on: ${{ matrix.os.image }}
include: ${{ fromJSON(needs.define-matrix.outputs.test_matrix) }}
name: Build ${{ matrix.download_name }}-py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
steps:
- name: Set shortver
run: echo "shortver=${longver//./}" >> $GITHUB_ENV
env:
longver: ${{ matrix.python-version }}
shell: bash
- name: Set up QEMU
if: ${{ matrix.os.id == 'manylinux_aarch64' }}
if: ${{ matrix.download_name == 'manylinux_aarch64' }}
uses: docker/setup-qemu-action@v2
with:
# xref https://github.com/docker/setup-qemu-action/issues/188
Expand All @@ -123,8 +121,8 @@ jobs:
- name: Building wheel
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: cp${{ env.shortver }}-${{ matrix.os.id }}
CIBW_ARCHS_WINDOWS: ${{ matrix.os.id == 'win_arm64' && 'ARM64' || 'auto' }}
CIBW_BUILD: cp${{ env.shortver }}-${{ matrix.download_name }}
CIBW_ARCHS_WINDOWS: ${{ matrix.download_name == 'win_arm64' && 'ARM64' || 'auto' }}
MACOSX_DEPLOYMENT_TARGET: 10.14 # Should be kept in sync with ci/build_darwin.sh
with:
output-dir: dist
Expand All @@ -134,49 +132,17 @@ jobs:
- uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: ${{ matrix.os.id }}_py${{ matrix.python-version }}
name: ${{ matrix.download_name }}_py${{ matrix.python-version }}
path: dist/

test:
name: Test ${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
needs: build
runs-on: ${{ matrix.os.image_name }}
name: Test ${{ matrix.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
needs: [build, define-matrix]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- image_name: ubuntu-latest
download_name: manylinux_x86_64
- image_name: macos-latest
download_name: macosx_x86_64
- image_name: windows-latest
download_name: win_amd64
- image_name: windows-11-arm
download_name: win_arm64
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
cloud-provider: [aws, azure, gcp]
exclude:
- os:
image_name: windows-11-arm
download_name: win_arm64
python-version: "3.9"
- os:
image_name: windows-11-arm
download_name: win_arm64
python-version: "3.10"
- os:
image_name: windows-11-arm
download_name: win_arm64
python-version: "3.11"
- os:
image_name: windows-11-arm
download_name: win_arm64
python-version: "3.12"
- os:
image_name: windows-11-arm
download_name: win_arm64
python-version: "3.13"

include: ${{ fromJSON(needs.define-matrix.outputs.test_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -188,7 +154,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4 # for wiremock
with:
java-version: ${{ matrix.os.download_name == 'win_arm64' && '21.0.5+11.0.LTS' || '11' }}
java-version: ${{ matrix.download_name == 'win_arm64' && '21.0.5+11.0.LTS' || '11' }}
distribution: 'temurin'
java-package: 'jre'
- name: Fetch Wiremock
Expand All @@ -211,7 +177,7 @@ jobs:
- name: Download wheel(s)
uses: actions/download-artifact@v4
with:
name: ${{ matrix.os.download_name }}_py${{ matrix.python-version }}
name: ${{ matrix.download_name }}_py${{ matrix.python-version }}
path: dist
- name: Show wheels downloaded
run: ls -lh dist
Expand All @@ -236,15 +202,15 @@ jobs:
if: always()
with:
include-hidden-files: true
name: coverage_${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
name: coverage_${{ matrix.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
path: |
.tox/.coverage
.tox/coverage.xml
- uses: actions/upload-artifact@v4
if: always()
with:
include-hidden-files: true
name: junit_${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
name: junit_${{ matrix.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
path: |
.tox/junit.*.xml

Expand Down Expand Up @@ -391,8 +357,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
cloud-provider: [aws]
include: ${{ fromJSON(needs.define-matrix.outputs.test_matrix) }}
exclude:
- cloud-provider: gcp
- cloud-provider: azure
steps:
- name: Set shortver
run: echo "shortver=${longver//./}" >> $GITHUB_ENV
Expand Down
Loading
Loading