Skip to content

Commit c7bdea1

Browse files
Use a single .nvm file for all node version refs
1 parent c383dc8 commit c7bdea1

17 files changed

+96
-51
lines changed

.github/actions/frontend-build/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ inputs:
1515
default: 'false'
1616
node-version:
1717
description: 'Node.js version to use'
18-
required: false
19-
default: '23'
18+
required: true
2019

2120
runs:
2221
using: 'composite'

.github/actions/load-versions/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ outputs:
1111
ocaml-version:
1212
description: "OCaml version"
1313
value: ${{ steps.load.outputs.ocaml-version }}
14+
node-version:
15+
description: "Node.js version"
16+
value: ${{ steps.load.outputs.node-version }}
1417

1518
runs:
1619
using: composite
@@ -25,18 +28,33 @@ runs:
2528
RUST_STABLE=$(yq eval '.rust.stable' "$VERSIONS_FILE")
2629
RUST_NIGHTLY=$(yq eval '.rust.nightly' "$VERSIONS_FILE")
2730
OCAML_VERSION=$(yq eval '.ocaml.version' "$VERSIONS_FILE")
31+
NODE_VERSION_YAML=$(yq eval '.node.version' "$VERSIONS_FILE")
32+
33+
# Read node version from .nvmrc
34+
NODE_VERSION_NVMRC=$(cat .nvmrc)
35+
36+
# Verify that the versions match
37+
if [ "$NODE_VERSION_YAML" != "$NODE_VERSION_NVMRC" ]; then
38+
echo "Error: Node.js version mismatch!"
39+
echo " .github/config/versions.yaml: $NODE_VERSION_YAML"
40+
echo " .nvmrc: $NODE_VERSION_NVMRC"
41+
exit 1
42+
fi
2843
2944
# Set outputs
3045
echo "rust-stable=$RUST_STABLE" >> $GITHUB_OUTPUT
3146
echo "rust-nightly=$RUST_NIGHTLY" >> $GITHUB_OUTPUT
3247
echo "ocaml-version=$OCAML_VERSION" >> $GITHUB_OUTPUT
48+
echo "node-version=$NODE_VERSION_YAML" >> $GITHUB_OUTPUT
3349
3450
# Also set as environment variables for convenience
3551
echo "RUST_STABLE_VERSION=$RUST_STABLE" >> $GITHUB_ENV
3652
echo "RUST_NIGHTLY_VERSION=$RUST_NIGHTLY" >> $GITHUB_ENV
3753
echo "OCAML_VERSION=$OCAML_VERSION" >> $GITHUB_ENV
54+
echo "NODE_VERSION=$NODE_VERSION_YAML" >> $GITHUB_ENV
3855
3956
echo "Loaded versions:"
4057
echo " Rust stable: $RUST_STABLE"
4158
echo " Rust nightly: $RUST_NIGHTLY"
4259
echo " OCaml: $OCAML_VERSION"
60+
echo " Node.js: $NODE_VERSION_YAML"

.github/config/versions.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ rust:
1515

1616
ocaml:
1717
version: "4.14.2"
18+
19+
node:
20+
version: "24.11.0"

.github/workflows/docs.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
pull_request:
1010
workflow_dispatch:
1111

12-
env:
13-
NODE_VERSION: '20'
14-
1512
concurrency:
1613
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1714
cancel-in-progress: true
@@ -25,10 +22,13 @@ jobs:
2522
- name: Checkout repository
2623
uses: actions/checkout@v5
2724

25+
- id: versions
26+
uses: ./.github/actions/load-versions
27+
2828
- name: Setup Node.js
2929
uses: actions/setup-node@v6
3030
with:
31-
node-version: ${{ env.NODE_VERSION }}
31+
node-version: ${{ steps.versions.outputs.node-version }}
3232
cache: 'npm'
3333
cache-dependency-path: website/package-lock.json
3434

@@ -109,10 +109,13 @@ jobs:
109109
- name: Setup Pages
110110
uses: actions/configure-pages@v5
111111

112+
- id: versions
113+
uses: ./.github/actions/load-versions
114+
112115
- name: Setup Node.js
113116
uses: actions/setup-node@v6
114117
with:
115-
node-version: ${{ env.NODE_VERSION }}
118+
node-version: ${{ steps.versions.outputs.node-version }}
116119
cache: 'npm'
117120
cache-dependency-path: website/package-lock.json
118121

@@ -158,10 +161,13 @@ jobs:
158161
with:
159162
fetch-depth: 0
160163

164+
- id: versions
165+
uses: ./.github/actions/load-versions
166+
161167
- name: Setup Node.js
162168
uses: actions/setup-node@v6
163169
with:
164-
node-version: ${{ env.NODE_VERSION }}
170+
node-version: ${{ steps.versions.outputs.node-version }}
165171
cache: 'npm'
166172
cache-dependency-path: website/package-lock.json
167173

.github/workflows/frontend-macos-13.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: versions
20+
uses: ./.github/actions/load-versions
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.versions.outputs.node-version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-macos-14.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: versions
20+
uses: ./.github/actions/load-versions
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.versions.outputs.node-version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-macos-15.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: versions
20+
uses: ./.github/actions/load-versions
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.versions.outputs.node-version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-macos-latest.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: versions
20+
uses: ./.github/actions/load-versions
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.versions.outputs.node-version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-ubuntu-22-04.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: versions
20+
uses: ./.github/actions/load-versions
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.versions.outputs.node-version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-ubuntu-24-04-arm.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: versions
20+
uses: ./.github/actions/load-versions
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.versions.outputs.node-version }}
2226
test-build-commands: 'true'

0 commit comments

Comments
 (0)