Skip to content

Commit

Permalink
chore: upgrade deprecated macos-12 builds to macos-latest; expand mat…
Browse files Browse the repository at this point in the history
…rix testing
  • Loading branch information
leoromanovsky committed Nov 26, 2024
1 parent 760d58d commit ae3c118
Showing 1 changed file with 50 additions and 61 deletions.
111 changes: 50 additions & 61 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,36 @@ permissions:

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- runner: ubuntu-latest
target: s390x
- runner: ubuntu-latest
target: ppc64le
runner: [ubuntu-latest]
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: ${{ matrix.python-version }}

- name: Build wheels
uses: PyO3/maturin-action@v1
if: ${{ startsWith(matrix.platform.target, 'x86') }}
if: ${{ startsWith(matrix.target, 'x86') }}
with:
target: ${{ matrix.platform.target }}
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml
sccache: 'true'
manylinux: auto
before-script-linux: |
yum install -y perl-IPC-Cmd devtoolset-10-libatomic-devel
- name: Build wheels
uses: PyO3/maturin-action@v1
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
if: ${{ !startsWith(matrix.target, 'x86') }}
with:
target: ${{ matrix.platform.target }}
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml
sccache: 'true'
manylinux: auto
Expand All @@ -72,11 +63,11 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
name: wheels-linux-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.python-version }}
path: dist

- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
if: ${{ startsWith(matrix.target, 'x86_64') }}
shell: bash
run: |
set -ex
Expand All @@ -87,10 +78,10 @@ jobs:
npm ci
npm run with-server test:python
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
arch: ${{ matrix.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
Expand All @@ -104,39 +95,34 @@ jobs:
npm run with-server test:python
musllinux:
runs-on: ${{ matrix.platform.runner }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
runner: [ubuntu-latest]
target: [x86_64, x86, aarch64, armv7]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml
sccache: 'true'
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
name: wheels-musllinux-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.python-version }}
path: dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
if: ${{ startsWith(matrix.target, 'x86_64') }}
uses: addnab/docker-run-action@v3
with:
image: alpine:latest
Expand All @@ -154,10 +140,10 @@ jobs:
# `npm ci` just hangs on Alpine armv7 now.
# Disabling tests until this issue is fixed:
# https://github.com/nodejs/docker-node/issues/1829
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'armv7' }}
if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'armv7' }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
arch: ${{ matrix.target }}
distro: alpine_latest
githubToken: ${{ github.token }}
install: |
Expand All @@ -172,35 +158,34 @@ jobs:
npm run with-server test:python
windows:
runs-on: ${{ matrix.platform.runner }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
runner: [windows-latest]
target: [x64, x86]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: ${{ matrix.platform.target }}
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
name: wheels-windows-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.python-version }}
path: dist
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
if: ${{ !startsWith(matrix.target, 'aarch64') }}
shell: bash
run: |
set -ex
Expand All @@ -212,39 +197,43 @@ jobs:
npm run with-server test:python
macos:
runs-on: ${{ matrix.platform.runner }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: macos-12
target: x86_64
# - runner: macos-14
# target: aarch64
runner: [macos-latest]
target: [aarch64] # x86_64
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./python-sdk/Cargo.toml
sccache: 'true'
- name: List dist directory
run: ls -l dist
- name: Debug dist contents
run: |
echo "Contents of dist directory:"
ls -la dist/
echo "File details:"
file dist/*
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
name: wheels-macos-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.python-version }}
path: dist
- name: pytest
run: |
set -ex
python3 -m venv .venv
source .venv/bin/activate
python --version
pip install --upgrade pip
pip install eppo-server-sdk --no-index --find-links dist --force-reinstall -v
pip install pytest cachetools
Expand Down

0 comments on commit ae3c118

Please sign in to comment.