Skip to content

Commit e836461

Browse files
committed
tests: Update workflows
1 parent 96ea060 commit e836461

4 files changed

Lines changed: 41 additions & 27 deletions

File tree

.github/actions/build-package/action.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ inputs:
44
python-version:
55
description: "Python version"
66
required: true
7-
target:
8-
description: "Target to build the package for"
9-
required: true
107

118
runs:
129
using: composite
@@ -15,14 +12,28 @@ runs:
1512
- uses: actions/setup-python@v5
1613
with:
1714
python-version: ${{ inputs.python-version }}
15+
- name: Set target based on OS and arch
16+
shell: bash
17+
run: |
18+
if [[ "${RUNNER_OS}" == "Linux" ]]; then
19+
echo "TARGET=x86_64-unknown-linux-gnu" >> $GITHUB_ENV
20+
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
21+
if [[ "${RUNNER_ARCH}" == "ARM64" ]]; then
22+
echo "TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
23+
else
24+
echo "TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
25+
fi
26+
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
27+
echo "TARGET=x86_64-pc-windows-msvc" >> $GITHUB_ENV
28+
fi
1829
- name: Build wheels
1930
uses: PyO3/maturin-action@v1
2031
with:
21-
target: ${{ inputs.target }}
32+
target: ${{ steps.target.outputs.target }}
2233
args: --release --out dist --find-interpreter
2334
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
2435
- name: Upload wheels
2536
uses: actions/upload-artifact@v4
2637
with:
27-
name: wheels-${{ inputs.target }}
38+
name: wheels-${{ steps.target.outputs.target }}
2839
path: dist

.github/actions/build-worker/action.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,28 @@ inputs:
44
python-version:
55
description: "Python version to use"
66
required: true
7-
target:
8-
description: "Target that is the worker is built for"
9-
required: true
107

118
runs:
129
using: composite
1310
steps:
1411
- name: Checkout repository
1512
uses: actions/checkout@v4
1613

14+
- name: Set target based on OS and arch
15+
shell: bash
16+
run: |
17+
if [[ "${RUNNER_OS}" == "Linux" ]]; then
18+
echo "TARGET=x86_64-unknown-linux-gnu" >> $GITHUB_ENV
19+
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
20+
if [[ "${RUNNER_ARCH}" == "ARM64" ]]; then
21+
echo "TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
22+
else
23+
echo "TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
24+
fi
25+
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
26+
echo "TARGET=x86_64-pc-windows-msvc" >> $GITHUB_ENV
27+
fi
28+
1729
- name: Set up Python ${{ inputs.python-version }}
1830
uses: actions/setup-python@v5
1931
with:
@@ -27,14 +39,14 @@ runs:
2739

2840
- name: Build
2941
shell: bash -euxo pipefail {0}
30-
run: scripts/build-worker.sh ${{ inputs.target }}
42+
run: scripts/build-worker.sh ${{ steps.target.outputs.target }}
3143

3244
- name: Package the worker (Linux)
3345
if: runner.os == 'Linux'
3446
shell: bash -euxo pipefail {0}
3547
run: |
3648
cd dist
37-
mv fluxqueue-worker-${{ inputs.target }} fluxqueue-worker
49+
mv fluxqueue-worker-${{ steps.target.outputs.target }} fluxqueue-worker
3850
tar -czvf fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-linux-x86_64.tar.gz fluxqueue-worker
3951
rm fluxqueue-worker
4052
@@ -43,21 +55,21 @@ runs:
4355
shell: bash -euxo pipefail {0}
4456
run: |
4557
cd dist
46-
mv fluxqueue-worker-${{ inputs.target }} fluxqueue-worker
47-
zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-${{ inputs.target }}.zip fluxqueue-worker
58+
mv fluxqueue-worker-${{ steps.target.outputs.target }} fluxqueue-worker
59+
zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-${{ steps.target.outputs.target }}.zip fluxqueue-worker
4860
rm fluxqueue-worker
4961
5062
- name: Package the worker (Windows)
5163
if: runner.os == 'Windows'
52-
shell: bash -euxo pipefail {0}
64+
shell: pwsh
5365
run: |
5466
cd dist
55-
mv fluxqueue-worker-${{ inputs.target }}.exe fluxqueue-worker.exe
56-
zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-windows-x86_64.zip fluxqueue-worker.exe
67+
mv fluxqueue-worker-${{ steps.target.outputs.target }}.exe fluxqueue-worker.exe
68+
Compress-Archive -Path fluxqueue-worker.exe -DestinationPath fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-windows-x86_64.zip
5769
rm fluxqueue-worker.exe
5870
5971
- name: Upload build artifact
6072
uses: actions/upload-artifact@v4
6173
with:
62-
name: fluxqueue-worker-${{ inputs.target }}-py${{ inputs.python-version }}
74+
name: fluxqueue-worker-${{ steps.target.outputs.target }}-py${{ inputs.python-version }}
6375
path: dist/*

.github/workflows/release-worker.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,15 @@ jobs:
2222
name: ${{ matrix.os }} (Py ${{ matrix.python-version }})
2323
strategy:
2424
matrix:
25+
os: [ubuntu-latest, macos-15-arm64, macos-15-intel, windows-latest]
2526
python-version: ["3.11", "3.12", "3.13", "3.14"]
26-
include:
27-
- os: ubuntu-latest
28-
target: x86_64-unknown-linux-gnu
29-
- os: macos-15-intel
30-
target: x86_64-apple-darwin
31-
- os: macos-latest
32-
target: aarch64-apple-darwin
33-
- os: windows-latest
34-
target: x86_64-pc-windows-msvc
3527
runs-on: ${{ matrix.os }}
3628
steps:
3729
- uses: actions/checkout@v4
3830
- name: Run Build Suite
3931
uses: ./.github/actions/build-worker
4032
with:
4133
python-version: ${{ matrix.python-version }}
42-
target: ${{ matrix.target }}
4334

4435
release:
4536
if: github.repository_owner == 'ccxlv'

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37+
os: [ubuntu-latest, macos-15-arm64, macos-15-intel, windows-latest]
3738
python-version: ["3.11", "3.12", "3.13", "3.14"]
38-
os: [ubuntu-latest, macos-15-intel, macos-latest]
3939
runs-on: ${{ matrix.os }}
4040
steps:
4141
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)