Skip to content

Commit e79c612

Browse files
mrTuomoKcursoragent
andcommitted
build: upgrade to Node 24 and fix Docker pnpm installs
Move CI and UBI images to Node 24, install pnpm via npm because corepack is missing on ubi9/nodejs-24, and allow Linux ffmpeg postinstall scripts for container builds. Vendor ci-pnpm-node with Node-before-pnpm setup required by pnpm 11.5. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e5fd68b commit e79c612

27 files changed

Lines changed: 522 additions & 267 deletions

.github/workflows/ci-events-graphql-proxy-check.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ on:
2626

2727
jobs:
2828
common:
29-
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
29+
uses: ./.github/workflows/ci-pnpm-node.yml
3030
secrets: inherit
3131
with:
32-
node-version: 22
32+
node-version: '24'
33+
pnpm-version: '11.5.1'
3334
typecheck: true
3435
app-directory: proxies/events-graphql-proxy
3536
extra-commands: |

.github/workflows/ci-events-helsinki-check.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ env:
3535

3636
jobs:
3737
common:
38-
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
38+
uses: ./.github/workflows/ci-pnpm-node.yml
3939
secrets: inherit
4040
with:
41-
node-version: 22
41+
node-version: '24'
42+
pnpm-version: '11.5.1'
4243
typecheck: true
4344
app-directory: apps/events-helsinki
4445
extra-commands: |

.github/workflows/ci-hobbies-helsinki-check.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ on:
3030

3131
jobs:
3232
common:
33-
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
33+
uses: ./.github/workflows/ci-pnpm-node.yml
3434
secrets: inherit
3535
with:
36-
node-version: 22
36+
node-version: '24'
37+
pnpm-version: '11.5.1'
3738
typecheck: true
3839
app-directory: apps/hobbies-helsinki
3940
extra-commands: |

.github/workflows/ci-monorepo-integrity.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,25 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
node-version: [22.x]
23+
node-version: [24.x]
2424
steps:
2525
- uses: actions/checkout@v4
2626

27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v4
29+
with:
30+
# pnpm 11.5+ requires Node >=22.13; setup Node before pnpm/action-setup
31+
node-version: '24'
32+
2733
- name: Setup pnpm
2834
uses: pnpm/action-setup@v4
2935
with:
30-
version: 11
36+
version: 11.5.1
3137

32-
- name: Use Node.js ${{ matrix.node-version }}
38+
- name: Cache pnpm store
3339
uses: actions/setup-node@v4
3440
with:
35-
node-version: ${{ matrix.node-version }}
41+
node-version: '24'
3642
cache: pnpm
3743

3844
- name: Install dependencies

.github/workflows/ci-packages.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,27 @@ jobs:
3434
runs-on: ubuntu-latest
3535
strategy:
3636
matrix:
37-
node-version: [22.x]
37+
node-version: [24.x]
3838
steps:
3939
- uses: actions/checkout@v4
4040
with:
4141
fetch-depth: 0
4242

43+
- name: Use Node.js ${{ matrix.node-version }}
44+
uses: actions/setup-node@v4
45+
with:
46+
# pnpm 11.5+ requires Node >=22.13; setup Node before pnpm/action-setup
47+
node-version: '24'
48+
4349
- name: Setup pnpm
4450
uses: pnpm/action-setup@v4
4551
with:
4652
version: 11.5.1
4753

48-
- name: Use Node.js ${{ matrix.node-version }}
54+
- name: Cache pnpm store
4955
uses: actions/setup-node@v4
5056
with:
51-
node-version: ${{ matrix.node-version }}
57+
node-version: '24'
5258
cache: pnpm
5359

5460
- name: Restore packages cache

.github/workflows/ci-pnpm-node.yml

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# Vendored from City-of-Helsinki/.github with Node-before-pnpm setup order
2+
# (pnpm 11.5+ requires Node >=22.13 at install time; CI uses Node 24).
3+
name: Common CI for Node (pnpm)
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
node-version:
9+
description: Node version to use
10+
required: true
11+
type: string
12+
pnpm-version:
13+
description: pnpm version to use
14+
required: false
15+
type: string
16+
default: '11.5.1'
17+
extra-commands:
18+
description: Extra setup commands to run before lint/test/build
19+
required: false
20+
type: string
21+
app-directory:
22+
description: Application subdirectory for lint/test/build
23+
required: false
24+
type: string
25+
default: '.'
26+
typecheck:
27+
description: Run type checking
28+
required: false
29+
type: boolean
30+
default: false
31+
upload-artifacts:
32+
description: Upload build artifacts
33+
required: false
34+
type: boolean
35+
default: false
36+
skip-sonar:
37+
description: Skip SonarQube
38+
required: false
39+
type: boolean
40+
default: false
41+
skip-build:
42+
description: Skip build phase
43+
required: false
44+
type: boolean
45+
default: false
46+
working-directory:
47+
description: Working directory for install/build/test jobs
48+
required: false
49+
type: string
50+
default: '.'
51+
ignore-scripts:
52+
description: Pass --ignore-scripts to pnpm install
53+
required: false
54+
type: boolean
55+
default: true
56+
secrets:
57+
SONAR_TOKEN:
58+
description: 'SonarQube Cloud token'
59+
required: true
60+
workflow_dispatch:
61+
62+
jobs:
63+
commitlint:
64+
name: Check commit messages
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
- name: Run commitlint
70+
uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1
71+
72+
build:
73+
name: Lint and build
74+
if: ${{ !inputs.skip-build }}
75+
runs-on: ubuntu-latest
76+
defaults:
77+
run:
78+
working-directory: ${{ inputs.working-directory }}
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- name: Setup Node.js
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: ${{ inputs.node-version }}
86+
87+
- name: Setup pnpm
88+
uses: pnpm/action-setup@v4
89+
with:
90+
version: ${{ inputs.pnpm-version }}
91+
92+
- name: Setup Node.js with dependency path
93+
if: ${{ inputs.working-directory != '.' }}
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version: ${{ inputs.node-version }}
97+
cache: pnpm
98+
cache-dependency-path: ${{ inputs.working-directory }}/pnpm-lock.yaml
99+
100+
- name: Setup Node.js without dependency path
101+
if: ${{ inputs.working-directory == '.' }}
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: ${{ inputs.node-version }}
105+
cache: pnpm
106+
107+
- name: Install dependencies
108+
run: |
109+
IGNORE_SCRIPTS="${{ inputs.ignore-scripts == true && '--ignore-scripts' || '' }}"
110+
pnpm install --frozen-lockfile $IGNORE_SCRIPTS
111+
112+
- name: Run extra commands
113+
if: ${{ inputs.extra-commands != '' }}
114+
run: ${{ inputs.extra-commands }}
115+
116+
- name: Typecheck application
117+
if: ${{ inputs.typecheck }}
118+
working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
119+
run: pnpm typecheck
120+
121+
- name: Lint application
122+
working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
123+
run: pnpm lint
124+
125+
- name: Build application
126+
working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
127+
run: pnpm build
128+
129+
- name: Upload build
130+
if: ${{ inputs.upload-artifacts }}
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: build-artifacts-${{ inputs.node-version }}
134+
path: |
135+
${{ inputs.app-directory }}/dist
136+
${{ inputs.app-directory }}/build
137+
${{ inputs.app-directory }}/lib
138+
retention-days: 1
139+
140+
- name: Check browser bundle size limits
141+
if: ${{ hashFiles(format('{0}/.size-limit.js', inputs.app-directory)) != '' }}
142+
working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
143+
run: pnpm check-size
144+
145+
- name: Check ecmascript checks for build files
146+
if: ${{ hashFiles(format('{0}/.escheckrc', inputs.app-directory)) != '' }}
147+
working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
148+
run: pnpm check-dist
149+
150+
tests:
151+
name: Test
152+
runs-on: ubuntu-latest
153+
defaults:
154+
run:
155+
working-directory: ${{ inputs.working-directory }}
156+
steps:
157+
- uses: actions/checkout@v4
158+
159+
- name: Setup Node.js
160+
uses: actions/setup-node@v4
161+
with:
162+
node-version: ${{ inputs.node-version }}
163+
164+
- name: Setup pnpm
165+
uses: pnpm/action-setup@v4
166+
with:
167+
version: ${{ inputs.pnpm-version }}
168+
169+
- name: Setup Node.js with dependency path
170+
if: ${{ inputs.working-directory != '.' }}
171+
uses: actions/setup-node@v4
172+
with:
173+
node-version: ${{ inputs.node-version }}
174+
cache: pnpm
175+
cache-dependency-path: ${{ inputs.working-directory }}/pnpm-lock.yaml
176+
177+
- name: Setup Node.js without dependency path
178+
if: ${{ inputs.working-directory == '.' }}
179+
uses: actions/setup-node@v4
180+
with:
181+
node-version: ${{ inputs.node-version }}
182+
cache: pnpm
183+
184+
- name: Install dependencies
185+
run: |
186+
IGNORE_SCRIPTS="${{ inputs.ignore-scripts == true && '--ignore-scripts' || '' }}"
187+
pnpm install --frozen-lockfile $IGNORE_SCRIPTS
188+
189+
- name: Run extra commands
190+
if: ${{ inputs.extra-commands != '' }}
191+
run: ${{ inputs.extra-commands }}
192+
193+
- name: Run tests
194+
working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
195+
run: pnpm test:coverage
196+
env:
197+
CI: true
198+
199+
- name: Store coverage report
200+
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
201+
with:
202+
path: ${{ (inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) && format('{0}/', inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) || ''}}coverage
203+
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
204+
205+
sonarcloud:
206+
name: Run SonarQube Cloud Scan
207+
if: ${{ !inputs.skip-sonar }}
208+
runs-on: ubuntu-latest
209+
needs: tests
210+
defaults:
211+
run:
212+
working-directory: ${{ inputs.working-directory }}
213+
steps:
214+
- uses: actions/checkout@v4
215+
with:
216+
fetch-depth: 0
217+
218+
- name: Restore coverage report
219+
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
220+
with:
221+
path: ${{ (inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) && format('{0}/', inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) || ''}}coverage
222+
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
223+
fail-on-cache-miss: true
224+
225+
- name: Override coverage report source path for SonarQube Cloud
226+
working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
227+
run: |
228+
find coverage -type f \( -name '*.info' -o -name 'lcov.info' \) 2>/dev/null | xargs -r sed -i 's@SF:'$GITHUB_WORKSPACE'@SF:/github/workspace/@g' || true
229+
find coverage -type f -name '*.json' 2>/dev/null | xargs -r sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' || true
230+
231+
- name: SonarQube Cloud Scan
232+
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8.0.0
233+
with:
234+
projectBaseDir: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }}
235+
env:
236+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/ci-sports-helsinki-check.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ on:
2929

3030
jobs:
3131
common:
32-
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
32+
uses: ./.github/workflows/ci-pnpm-node.yml
3333
secrets: inherit
3434
with:
35-
node-version: 22
35+
node-version: '24'
36+
pnpm-version: '11.5.1'
3637
typecheck: true
3738
app-directory: apps/sports-helsinki
3839
extra-commands: |

.github/workflows/ci-venue-graphql-proxy-check.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ on:
2626

2727
jobs:
2828
common:
29-
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
29+
uses: ./.github/workflows/ci-pnpm-node.yml
3030
secrets: inherit
3131
with:
32-
node-version: 22
32+
node-version: '24'
33+
pnpm-version: '11.5.1'
3334
typecheck: true
3435
app-directory: proxies/venue-graphql-proxy
3536
extra-commands: |

0 commit comments

Comments
 (0)