Skip to content

Commit 92d700a

Browse files
committed
ci: define node version once and use it everywhere
1 parent 28c09ea commit 92d700a

File tree

6 files changed

+41
-19
lines changed

6 files changed

+41
-19
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ on:
1313
required: false
1414
default: false
1515

16-
env:
17-
NODE_VERSION: '22.x'
18-
1916
jobs:
17+
config:
18+
uses: ./.github/workflows/shared-config.yml
19+
2020
build-mac-and-windows:
21+
needs: [config]
2122
runs-on: macos-latest
2223
strategy:
2324
matrix:
@@ -29,7 +30,7 @@ jobs:
2930
- name: Setup Node.js
3031
uses: actions/setup-node@v4
3132
with:
32-
node-version: ${{ env.NODE_VERSION }}
33+
node-version: ${{ needs.config.outputs.node-version }}
3334
cache: 'npm'
3435

3536
- name: Install dependencies
@@ -48,13 +49,14 @@ jobs:
4849

4950
build-linux-appimage:
5051
runs-on: ubuntu-latest
52+
needs: [config]
5153
steps:
5254
- uses: actions/checkout@v4
5355

5456
- name: Setup Node.js
5557
uses: actions/setup-node@v4
5658
with:
57-
node-version: ${{ env.NODE_VERSION }}
59+
node-version: ${{ needs.config.outputs.node-version }}
5860
cache: 'npm'
5961

6062
- name: Install dependencies
@@ -74,6 +76,7 @@ jobs:
7476

7577
build-linux-flatpak:
7678
runs-on: ubuntu-latest
79+
needs: [config]
7780
container:
7881
image: bilelmoussaoui/flatpak-github-actions:kde-6.5
7982
options: --privileged
@@ -86,7 +89,7 @@ jobs:
8689
- name: Set up Node.js
8790
uses: actions/setup-node@v3
8891
with:
89-
node-version: ${{ env.NODE_VERSION }}
92+
node-version: ${{ needs.config.outputs.node-version }}
9093
cache: 'npm'
9194

9295
- name: Install dependencies

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ on:
1616
branches: ['main']
1717
pull_request:
1818
branches: ['main']
19-
schedule:
20-
- cron: '40 23 * * 3'
19+
# schedule:
20+
# - cron: '40 23 * * 3'
2121

2222
jobs:
2323
analyze:

.github/workflows/flatpak.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ on:
1010
default: false
1111

1212
jobs:
13+
config:
14+
uses: ./.github/workflows/shared-config.yml
15+
1316
flatpak:
1417
runs-on: ubuntu-latest
18+
needs: [config]
1519
container:
1620
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
1721
options: --privileged
@@ -24,7 +28,7 @@ jobs:
2428
- name: Set up Node.js
2529
uses: actions/setup-node@v4
2630
with:
27-
node-version: '21.x'
31+
node-version: ${{ needs.config.outputs.node-version }}
2832
cache: 'npm'
2933

3034
- name: Install dependencies

.github/workflows/linux-appimage-build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: AppImage Build (Testing)
32

43
on:
@@ -10,19 +9,20 @@ on:
109
required: false
1110
default: false
1211

13-
env:
14-
NODE_VERSION: '22.x'
15-
1612
jobs:
13+
config:
14+
uses: ./.github/workflows/shared-config.yml
15+
1716
build-linux-appimage:
1817
runs-on: ubuntu-latest
18+
needs: [config]
1919
steps:
2020
- uses: actions/checkout@v4
2121

2222
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: ${{ env.NODE_VERSION }}
25+
node-version: ${{ needs.config.outputs.node-version }}
2626
cache: 'npm'
2727

2828
- name: Install dependencies

.github/workflows/shared-config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Shared Configuration
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
node-version:
7+
description: 'Node.js version to use'
8+
value: '22.x'
9+
10+
jobs:
11+
noop:
12+
runs-on: ubuntu-latest
13+
steps: []

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
# We should really have some tests!
33
name: Test
44

5-
on:
6-
workflow_dispatch
5+
on: workflow_dispatch
76

87
jobs:
8+
config:
9+
uses: ./.github/workflows/shared-config.yml
10+
911
test:
1012
runs-on: ${{ matrix.os }}
11-
13+
needs: [config]
1214
strategy:
1315
matrix:
1416
os: [macos-latest, windows-latest, ubuntu-latest]
@@ -20,7 +22,7 @@ jobs:
2022
- name: Install Node.js and NPM
2123
uses: actions/setup-node@v4
2224
with:
23-
node-version: 22
25+
node-version: ${{ needs.config.outputs.node-version }}
2426
cache: npm
2527

2628
- name: npm install
@@ -31,7 +33,7 @@ jobs:
3133
env:
3234
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3335
run: |
34-
npm run package
36+
npm run build
3537
npm run lint
3638
npm exec tsc
3739
npm test

0 commit comments

Comments
 (0)