Skip to content

Commit a049c1c

Browse files
committed
template: Simplify job matrix
We are currently not using the distinction between "os" and "arch", and only using both to construct the `runs-on:` string. This makes things much more complicated than necessary, so this commit updates the matrix to use a single 'platform' key that we can use directly in `runs-on`. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
1 parent bf3f395 commit a049c1c

6 files changed

Lines changed: 36 additions & 60 deletions

File tree

  • cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows
  • tests_golden/integration/test_cookiecutter_generation
    • actor/frequenz-actor-test/.github/workflows
    • api/frequenz-api-test/.github/workflows
    • app/frequenz-app-test/.github/workflows
    • lib/frequenz-test-python/.github/workflows
    • model/frequenz-model-test/.github/workflows

cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/ci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ jobs:
6161
strategy:
6262
fail-fast: false
6363
matrix:
64-
arch:
65-
- amd64
66-
- arm
67-
os:
64+
platform:
6865
- ubuntu-24.04
66+
- ubuntu-24.04-arm
6967
python:
7068
- "3.11"
7169
- "3.12"
@@ -74,7 +72,7 @@ jobs:
7472
# that uses the same venv to run multiple linting sessions
7573
- "ci_checks_max"
7674
- "pytest_min"
77-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
75+
runs-on: ${{ matrix.platform }}
7876

7977
steps:
8078
- name: Run nox
@@ -145,15 +143,13 @@ jobs:
145143
strategy:
146144
fail-fast: false
147145
matrix:
148-
arch:
149-
- amd64
150-
- arm
151-
os:
146+
platform:
152147
- ubuntu-24.04
148+
- ubuntu-24.04-arm
153149
python:
154150
- "3.11"
155151
- "3.12"
156-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
152+
runs-on: ${{ matrix.platform }}
157153

158154
steps:
159155
- name: Setup Git

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/workflows/ci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
arch:
32-
- amd64
33-
- arm
34-
os:
31+
platform:
3532
- ubuntu-24.04
33+
- ubuntu-24.04-arm
3634
python:
3735
- "3.11"
3836
- "3.12"
@@ -41,7 +39,7 @@ jobs:
4139
# that uses the same venv to run multiple linting sessions
4240
- "ci_checks_max"
4341
- "pytest_min"
44-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
42+
runs-on: ${{ matrix.platform }}
4543

4644
steps:
4745
- name: Run nox
@@ -112,15 +110,13 @@ jobs:
112110
strategy:
113111
fail-fast: false
114112
matrix:
115-
arch:
116-
- amd64
117-
- arm
118-
os:
113+
platform:
119114
- ubuntu-24.04
115+
- ubuntu-24.04-arm
120116
python:
121117
- "3.11"
122118
- "3.12"
123-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
119+
runs-on: ${{ matrix.platform }}
124120

125121
steps:
126122
- name: Setup Git

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/workflows/ci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ jobs:
5858
strategy:
5959
fail-fast: false
6060
matrix:
61-
arch:
62-
- amd64
63-
- arm
64-
os:
61+
platform:
6562
- ubuntu-24.04
63+
- ubuntu-24.04-arm
6664
python:
6765
- "3.11"
6866
- "3.12"
@@ -71,7 +69,7 @@ jobs:
7169
# that uses the same venv to run multiple linting sessions
7270
- "ci_checks_max"
7371
- "pytest_min"
74-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
72+
runs-on: ${{ matrix.platform }}
7573

7674
steps:
7775
- name: Run nox
@@ -142,15 +140,13 @@ jobs:
142140
strategy:
143141
fail-fast: false
144142
matrix:
145-
arch:
146-
- amd64
147-
- arm
148-
os:
143+
platform:
149144
- ubuntu-24.04
145+
- ubuntu-24.04-arm
150146
python:
151147
- "3.11"
152148
- "3.12"
153-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
149+
runs-on: ${{ matrix.platform }}
154150

155151
steps:
156152
- name: Setup Git

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/workflows/ci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
arch:
32-
- amd64
33-
- arm
34-
os:
31+
platform:
3532
- ubuntu-24.04
33+
- ubuntu-24.04-arm
3634
python:
3735
- "3.11"
3836
- "3.12"
@@ -41,7 +39,7 @@ jobs:
4139
# that uses the same venv to run multiple linting sessions
4240
- "ci_checks_max"
4341
- "pytest_min"
44-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
42+
runs-on: ${{ matrix.platform }}
4543

4644
steps:
4745
- name: Run nox
@@ -112,15 +110,13 @@ jobs:
112110
strategy:
113111
fail-fast: false
114112
matrix:
115-
arch:
116-
- amd64
117-
- arm
118-
os:
113+
platform:
119114
- ubuntu-24.04
115+
- ubuntu-24.04-arm
120116
python:
121117
- "3.11"
122118
- "3.12"
123-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
119+
runs-on: ${{ matrix.platform }}
124120

125121
steps:
126122
- name: Setup Git

tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/workflows/ci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
arch:
32-
- amd64
33-
- arm
34-
os:
31+
platform:
3532
- ubuntu-24.04
33+
- ubuntu-24.04-arm
3634
python:
3735
- "3.11"
3836
- "3.12"
@@ -41,7 +39,7 @@ jobs:
4139
# that uses the same venv to run multiple linting sessions
4240
- "ci_checks_max"
4341
- "pytest_min"
44-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
42+
runs-on: ${{ matrix.platform }}
4543

4644
steps:
4745
- name: Run nox
@@ -112,15 +110,13 @@ jobs:
112110
strategy:
113111
fail-fast: false
114112
matrix:
115-
arch:
116-
- amd64
117-
- arm
118-
os:
113+
platform:
119114
- ubuntu-24.04
115+
- ubuntu-24.04-arm
120116
python:
121117
- "3.11"
122118
- "3.12"
123-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
119+
runs-on: ${{ matrix.platform }}
124120

125121
steps:
126122
- name: Setup Git

tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/ci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
arch:
32-
- amd64
33-
- arm
34-
os:
31+
platform:
3532
- ubuntu-24.04
33+
- ubuntu-24.04-arm
3634
python:
3735
- "3.11"
3836
- "3.12"
@@ -41,7 +39,7 @@ jobs:
4139
# that uses the same venv to run multiple linting sessions
4240
- "ci_checks_max"
4341
- "pytest_min"
44-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
42+
runs-on: ${{ matrix.platform }}
4543

4644
steps:
4745
- name: Run nox
@@ -112,15 +110,13 @@ jobs:
112110
strategy:
113111
fail-fast: false
114112
matrix:
115-
arch:
116-
- amd64
117-
- arm
118-
os:
113+
platform:
119114
- ubuntu-24.04
115+
- ubuntu-24.04-arm
120116
python:
121117
- "3.11"
122118
- "3.12"
123-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
119+
runs-on: ${{ matrix.platform }}
124120

125121
steps:
126122
- name: Setup Git

0 commit comments

Comments
 (0)