Skip to content

Commit 5fbd079

Browse files
committed
update github workflow
1 parent 6228c11 commit 5fbd079

File tree

1 file changed

+43
-35
lines changed

1 file changed

+43
-35
lines changed

.github/workflows/test_and_deploy.yml

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
python-version: ['3.8', '3.9', '3.10', '3.11']
16-
os: [ubuntu-20.04, macos-latest]
15+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
16+
os: [ubuntu-latest, macos-latest]
1717
fail-fast: false
1818
steps:
1919
- name: Setup Python ${{ matrix.python-version }} env
2020
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
- name: Ensure latest pip & wheel
24-
run: python -m pip install -q --upgrade pip wheel
23+
- name: Ensure latest pip, wheel & setuptools
24+
run: python -m pip install -q --upgrade pip wheel setuptools
2525
- name: Install dependencies
2626
run: |
2727
if [ "$RUNNER_OS" == "Linux" ]; then
@@ -53,8 +53,8 @@ jobs:
5353
uses: actions/setup-python@v5
5454
with:
5555
python-version: 3.8
56-
- name: Ensure latest pip & wheel
57-
run: python -m pip install -q --upgrade pip wheel
56+
- name: Ensure latest pip, wheel & setuptools
57+
run: python -m pip install -q --upgrade pip wheel setuptools
5858
- name: Install dependencies
5959
run: |
6060
brew install cmake
@@ -75,17 +75,17 @@ jobs:
7575
pushd ..
7676
python -m pytest --import-mode=append -svx $REPONAME/nle/tests
7777
popd
78-
test_sdist_3_11:
79-
name: Test sdist on MacOS w/ Py3.11
78+
test_sdist_3_12:
79+
name: Test sdist on MacOS w/ Py3.12
8080
needs: test_repo
8181
runs-on: macos-latest
8282
steps:
83-
- name: Setup Python 3.11 env
83+
- name: Setup Python 3.12 env
8484
uses: actions/setup-python@v5
8585
with:
86-
python-version: 3.11
87-
- name: Ensure latest pip & wheel
88-
run: python -m pip install -q --upgrade pip wheel
86+
python-version: 3.12
87+
- name: Ensure latest pip, wheel & setuptools
88+
run: python -m pip install -q --upgrade pip wheel setuptools
8989
- name: Install dependencies
9090
run: |
9191
brew install cmake
@@ -115,21 +115,19 @@ jobs:
115115
build_wheels:
116116
name: Build wheels on Ubuntu
117117
needs: test_repo
118-
runs-on: ubuntu-20.04 # Can be also run for macOS
118+
runs-on: ${{ matrix.os }} # Can be also run for macOS
119+
strategy:
120+
matrix:
121+
os: [ubuntu-latest, ubuntu-24.04-arm]
119122
steps:
120123
- uses: actions/checkout@v4
121124
with:
122125
submodules: recursive
123-
- name: Set up QEMU # Required for building manylinux aarch64 wheels on x86_64
124-
if: runner.os == 'Linux'
125-
uses: docker/setup-qemu-action@v2
126-
with:
127-
platforms: all
128126
- name: Build wheels
129127
if: github.event_name != 'release'
130128
uses: pypa/[email protected] # The main configuration is in pyproject.toml
131129
env:
132-
CIBW_BUILD: "cp311-manylinux*" # Build only python 3.11 wheels for testing
130+
CIBW_BUILD: "cp312-manylinux*" # Build only python 3.12 wheels for testing
133131
# Increase verbosity to see what's going on in the build in case of failure
134132
CIBW_BUILD_VERBOSITY: 3
135133
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
@@ -143,30 +141,30 @@ jobs:
143141
- name: Save wheels
144142
uses: actions/upload-artifact@v4
145143
with:
146-
name: python-wheels
144+
name: python-wheels-${{ matrix.os }}
147145
path: ./wheelhouse/*.whl
148-
test_manylinux_3_11:
149-
name: Test manylinux wheel on Ubuntu w/ Py3.11
146+
test_manylinux_3_12:
147+
name: Test manylinux wheel on Ubuntu w/ Py3.12
150148
needs: build_wheels
151-
runs-on: ubuntu-20.04
149+
runs-on: ubuntu-latest
152150
steps:
153-
- name: Setup Python 3.11 env
151+
- name: Setup Python 3.12 env
154152
uses: actions/setup-python@v5
155153
with:
156-
python-version: 3.11
157-
- name: Ensure latest pip & wheel
158-
run: python -m pip install -q --upgrade pip wheel
154+
python-version: 3.12
155+
- name: Ensure latest pip, wheel & setuptools
156+
run: python -m pip install -q --upgrade pip wheel tools
159157
- uses: actions/checkout@v4
160158
with:
161159
submodules: true
162160
- name: Get wheels artifacts
163161
uses: actions/download-artifact@v4
164162
with:
165-
name: python-wheels
163+
name: python-wheels-ubuntu-latest
166164
path: dist
167165
- name: Install from wheel # Install wheel mathcing the Python version and architecture
168166
run: |
169-
WHEELNAME=$(ls dist/*311*manylinux*x86_64*.whl)
167+
WHEELNAME=$(ls dist/*312*manylinux*x86_64*.whl)
170168
MODE="[all]"
171169
pip install "$WHEELNAME$MODE"
172170
- name: Run tests outside repo dir
@@ -179,7 +177,7 @@ jobs:
179177
# Use prereleases to test publish the artefacts to testpypi
180178
test_deploy:
181179
name: Deploy artefacts to testpypi
182-
needs: [test_sdist_3_11, test_manylinux_3_11]
180+
needs: [test_sdist_3_12, test_manylinux_3_12]
183181
if: github.event_name == 'release' && github.event.action == 'prereleased'
184182
runs-on: ubuntu-latest
185183
environment:
@@ -199,10 +197,15 @@ jobs:
199197
with:
200198
name: python-sdist
201199
path: dist
202-
- name: Get wheels artifacts # Get wheels artifacts from the build_wheels job
200+
- name: Get wheels artifacts # Get x86 wheels artifacts from the build_wheels job
201+
uses: actions/download-artifact@v4
202+
with:
203+
name: python-wheels-ubuntu-latest
204+
path: dist
205+
- name: Get wheels artifacts # Get aarch64 wheels artifacts from the build_wheels job
203206
uses: actions/download-artifact@v4
204207
with:
205-
name: python-wheels
208+
name: python-wheels-ubuntu-24.04-arm
206209
path: dist
207210
- name: Report dist contents
208211
run: |
@@ -220,7 +223,7 @@ jobs:
220223
# functionalities like workflow dependencies :|
221224
deploy_sdist:
222225
name: Deploy sdist to pypi
223-
needs: [test_sdist_3_11, test_manylinux_3_11]
226+
needs: [test_sdist_3_12, test_manylinux_3_12]
224227
if: github.event_name == 'release' && github.event.action == 'released'
225228
runs-on: ubuntu-latest
226229
environment:
@@ -240,10 +243,15 @@ jobs:
240243
with:
241244
name: python-sdist
242245
path: dist
243-
- name: Get wheels artifacts # Get wheels artifacts from the build_wheels job
246+
- name: Get wheels artifacts # Get x86 wheels artifacts from the build_wheels job
247+
uses: actions/download-artifact@v4
248+
with:
249+
name: python-wheels-ubuntu-latest
250+
path: dist
251+
- name: Get wheels artifacts # Get aarch64 wheels artifacts from the build_wheels job
244252
uses: actions/download-artifact@v4
245253
with:
246-
name: python-wheels
254+
name: python-wheels-ubuntu-24.04-arm
247255
path: dist
248256
- name: Report dist contents
249257
run: |

0 commit comments

Comments
 (0)