Skip to content

Commit 4c1f2b7

Browse files
committed
Update CI to support building for multiple target platforms
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 78dc289 commit 4c1f2b7

File tree

1 file changed

+35
-39
lines changed

1 file changed

+35
-39
lines changed

.github/workflows/ci.yaml

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,30 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
arch:
32-
- amd64
33-
- arm
34-
os:
31+
target:
3532
- ubuntu-24.04
33+
- ubuntu-24.04-arm
34+
- windows-latest
35+
- macos-15-intel
36+
- macos-15
3637
python:
3738
- "3.11"
3839
- "3.12"
40+
- "3.13"
41+
- "3.14"
3942
nox-session:
4043
# To speed things up a bit we use the special ci_checks_max session
4144
# that uses the same venv to run multiple linting sessions
4245
- "ci_checks_max"
4346
- "pytest_min"
44-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
47+
runs-on: ${{ matrix.target }}
4548

4649
steps:
4750
- name: Run nox
4851
uses: frequenz-floss/[email protected]
4952
with:
5053
python-version: ${{ matrix.python }}
5154
nox-session: ${{ matrix.nox-session }}
52-
# TODO(cookiecutter): Uncomment this for projects with private dependencies
53-
# git-username: ${{ secrets.GIT_USER }}
54-
# git-password: ${{ secrets.GIT_PASS }}
5555

5656
# This job runs if all the `nox` matrix jobs ran and succeeded.
5757
# It is only used to have a single job that we can require in branch
@@ -72,18 +72,24 @@ jobs:
7272

7373
build:
7474
name: Build distribution packages
75-
# Since this is a pure Python package, we only need to build it once. If it
76-
# had any architecture specific code, we would need to build it for each
77-
# architecture.
78-
runs-on: ubuntu-24.04
79-
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
target:
79+
- ubuntu-24.04
80+
- ubuntu-24.04-arm
81+
- windows-latest
82+
- macos-15-intel
83+
- macos-15
84+
python:
85+
- "3.11"
86+
- "3.12"
87+
- "3.13"
88+
- "3.14"
89+
runs-on: ${{ matrix.target }}
8090
steps:
8191
- name: Setup Git
8292
uses: frequenz-floss/[email protected]
83-
# TODO(cookiecutter): Uncomment this for projects with private dependencies
84-
# with:
85-
# username: ${{ secrets.GIT_USER }}
86-
# password: ${{ secrets.GIT_PASS }}
8793

8894
- name: Fetch sources
8995
uses: actions/checkout@v5
@@ -93,7 +99,7 @@ jobs:
9399
- name: Setup Python
94100
uses: frequenz-floss/[email protected]
95101
with:
96-
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
102+
python-version: ${{ matrix.python }}
97103
dependencies: build
98104

99105
- name: Build the source and binary distribution
@@ -102,7 +108,7 @@ jobs:
102108
- name: Upload distribution files
103109
uses: actions/upload-artifact@v5
104110
with:
105-
name: dist-packages
111+
name: dist-packages-${{ matrix.target }}-${{ matrix.python }}
106112
path: dist/
107113
if-no-files-found: error
108114

@@ -112,35 +118,35 @@ jobs:
112118
strategy:
113119
fail-fast: false
114120
matrix:
115-
arch:
116-
- amd64
117-
- arm
118-
os:
121+
target:
119122
- ubuntu-24.04
123+
- ubuntu-24.04-arm
124+
- windows-latest
125+
- macos-15-intel
126+
- macos-15
120127
python:
121128
- "3.11"
122129
- "3.12"
123-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
130+
- "3.13"
131+
- "3.14"
132+
runs-on: ${{ matrix.target }}
124133

125134
steps:
126135
- name: Setup Git
127136
uses: frequenz-floss/[email protected]
128-
# TODO(cookiecutter): Uncomment this for projects with private dependencies
129-
# with:
130-
# username: ${{ secrets.GIT_USER }}
131-
# password: ${{ secrets.GIT_PASS }}
132137

133138
- name: Print environment (debug)
134139
run: env
135140

136141
- name: Download package
137142
uses: actions/download-artifact@v6
138143
with:
139-
name: dist-packages
144+
name: dist-packages-${{ matrix.target }}-${{ matrix.python }}
140145
path: dist
141146

142147
# This is necessary for the `pip` caching in the setup-python action to work
143148
- name: Fetch the pyproject.toml file for this action hash
149+
shell: bash
144150
env:
145151
GH_TOKEN: ${{ github.token }}
146152
REPO: ${{ github.repository }}
@@ -186,10 +192,6 @@ jobs:
186192
steps:
187193
- name: Setup Git
188194
uses: frequenz-floss/[email protected]
189-
# TODO(cookiecutter): Uncomment this for projects with private dependencies
190-
# with:
191-
# username: ${{ secrets.GIT_USER }}
192-
# password: ${{ secrets.GIT_PASS }}
193195

194196
- name: Fetch sources
195197
uses: actions/checkout@v5
@@ -226,10 +228,6 @@ jobs:
226228
steps:
227229
- name: Setup Git
228230
uses: frequenz-floss/[email protected]
229-
# TODO(cookiecutter): Uncomment this for projects with private dependencies
230-
# with:
231-
# username: ${{ secrets.GIT_USER }}
232-
# password: ${{ secrets.GIT_PASS }}
233231

234232
- name: Fetch sources
235233
uses: actions/checkout@v5
@@ -300,7 +298,6 @@ jobs:
300298
- name: Download distribution files
301299
uses: actions/download-artifact@v6
302300
with:
303-
name: dist-packages
304301
path: dist
305302

306303
- name: Download RELEASE_NOTES.md
@@ -346,7 +343,6 @@ jobs:
346343
- name: Download distribution files
347344
uses: actions/download-artifact@v6
348345
with:
349-
name: dist-packages
350346
path: dist
351347

352348
- name: Publish the Python distribution to PyPI

0 commit comments

Comments
 (0)