Skip to content

Commit ca8c6ca

Browse files
authored
ci: setup Go/Node.js from file (#4301)
1 parent 311b1ee commit ca8c6ca

File tree

6 files changed

+30
-37
lines changed

6 files changed

+30
-37
lines changed

.github/workflows/docs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
2828
- name: Setup Pages
2929
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
30-
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
30+
- name: Setup Node.js
31+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3132
with:
32-
node-version: '22.x'
33+
node-version-file: website/package.json
3334
- name: Build docs
3435
env:
3536
NODE_OPTIONS: "--max-old-space-size=4096"

.github/workflows/pr.yaml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ jobs:
1919
ci-js:
2020
name: CI Test JS
2121
runs-on: ubuntu-latest
22-
strategy:
23-
matrix:
24-
node-version: [22.x]
2522
steps:
2623
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
2724
- name: Node modules cache
@@ -36,10 +33,10 @@ jobs:
3633
${{ runner.os }}-build-${{ env.cache-name }}-
3734
${{ runner.os }}-build-
3835
${{ runner.os }}-
39-
- name: Use Node.js ${{ matrix.node-version }}
36+
- name: Setup Node.js
4037
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
4138
with:
42-
node-version: ${{ matrix.node-version }}
39+
node-version-file: package.json
4340
- run: make node_modules
4441
- name: Check that package.json & package-lock.json were updated in commit
4542
run: |
@@ -56,15 +53,12 @@ jobs:
5653
ci-go:
5754
name: CI Test Go
5855
runs-on: ubuntu-latest
59-
strategy:
60-
matrix:
61-
go-version: [1.23.X]
6256
steps:
6357
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
6458
- name: Setup Go
65-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
59+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
6660
with:
67-
go-version: ${{ matrix.go-version }}
61+
go-version-file: go.mod
6862
- name: Setup Flux CLI
6963
uses: fluxcd/flux2/action@709b17ce59d184427c1395bc70f496ba528d3bee # main
7064
with:
@@ -77,16 +71,12 @@ jobs:
7771
ci-static:
7872
name: CI Check Static Checks
7973
runs-on: ubuntu-latest
80-
strategy:
81-
matrix:
82-
go-version: [1.23.X]
83-
node-version: [22.x]
8474
steps:
8575
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
8676
- name: Setup Go
87-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
77+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
8878
with:
89-
go-version: ${{ matrix.go-version }}
79+
go-version-file: go.mod
9080
- run: make check-format
9181
- run: make lint
9282
- run: go mod tidy
@@ -186,10 +176,10 @@ jobs:
186176
os: [ubuntu-latest, macOS-latest]
187177
if: github.event_name == 'push'
188178
steps:
189-
- name: Install Go
190-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
179+
- name: Setup Go
180+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
191181
with:
192-
go-version: 1.23.X
182+
go-version-file: go.mod
193183
- name: Checkout code
194184
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
195185
- name: Clean
@@ -230,9 +220,10 @@ jobs:
230220
# We want the correct sha so we can tag the npm package correctly
231221
ref: ${{ github.event.pull_request.head.sha || github.sha }}
232222
fetch-depth: 0
233-
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
223+
- name: Setup Node.js
224+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
234225
with:
235-
node-version: "22.x"
226+
node-version-file: package.json
236227
registry-url: "https://npm.pkg.github.com"
237228
scope: "@weaveworks"
238229
- run: yarn

.github/workflows/prepare-release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
run: |
2525
git fetch --prune --unshallow
2626
- name: Setup Go
27-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
27+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2828
with:
29-
go-version: 1.23.X
29+
go-version-file: go.mod
3030
- name: Setup Node.js
3131
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3232
with:
33-
node-version: 22.x
33+
node-version-file: package.json
3434
- name: Set up environment vars
3535
run: |
3636
echo "BRANCH=releases/${{ github.event.inputs.version }}" >> $GITHUB_ENV

.github/workflows/release.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ jobs:
4949
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
5050
with:
5151
ref: ${{ github.event.pull_request.head.sha }}
52-
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
52+
- name: Setup Node.js
53+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
5354
with:
54-
node-version: "22.x"
55+
node-version-file: package.json
5556
registry-url: "https://npm.pkg.github.com"
5657
scope: "@weaveworks"
5758
- run: yarn
@@ -126,13 +127,13 @@ jobs:
126127
git fetch --prune --unshallow
127128
git fetch --tags -f
128129
- name: Setup Go
129-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
130+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
130131
with:
131-
go-version: 1.23.X
132-
- name: Use Node.js
132+
go-version-file: go.mod
133+
- name: Setup Node.js
133134
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
134135
with:
135-
node-version: 22.x
136+
node-version-file: package.json
136137
- name: Set env var
137138
env:
138139
GITHUB_EVENT_PULL_REQUEST_HEAD_REF: ${{ github.event.pull_request.head.ref }}

.github/workflows/scan.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
26-
- name: Install Go
27-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
26+
- name: Setup Go
27+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2828
with:
29-
go-version: 1.23.X
29+
go-version-file: go.mod
3030
- name: Run FOSSA scan and upload build data
3131
uses: fossa-contrib/fossa-action@6728dc6fe9a068c648d080c33829ffbe56565023 # v2.0.0
3232
with:

.github/workflows/upgrade-flux.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
- name: Checkout
3535
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
3636
- name: Setup Go
37-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
37+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3838
with:
39-
go-version: 1.23.X
39+
go-version-file: go.mod
4040
- name: Upgrade flux
4141
run: |
4242
sed -i 's/^FLUX_VERSION=.*/FLUX_VERSION=${{ needs.has-new-flux.outputs.version }}/' Makefile

0 commit comments

Comments
 (0)