Skip to content

Commit a91fcb7

Browse files
usmanmani1122mujahidkay
authored andcommitted
chore(ci): Make the Node versions in test matrix semantic (#11167)
closes: #11145 Updated the `test-all-packages` workflow to use semantic names in the engine matrix. This change will build up to smoothly transition between node version without affecting the required checks None None None The build should [pass](https://github.com/Agoric/agoric-sdk/actions/runs/14106899304) None
1 parent e960d6e commit a91fcb7

File tree

7 files changed

+65
-49
lines changed

7 files changed

+65
-49
lines changed

.github/actions/restore-node/action.yml

+24-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Set up Node.js environment and restore cached built files'
33

44
inputs:
55
node-version:
6-
description: 'The version of Node.js to use'
6+
description: 'The version or semantic name (node-old, node-new and xs supported) of Node.js to use'
77
required: true
88
path:
99
description: 'The relative path to the agoric-sdk directory'
@@ -34,6 +34,27 @@ runs:
3434
shell: bash
3535
run: echo ESM_DISABLE_CACHE=true >> $GITHUB_ENV
3636

37+
- id: set-node-version
38+
name: Set correct node version
39+
shell: bash
40+
run: |
41+
set -o xtrace
42+
43+
VERSION_IDENTIFIER="${{ inputs.node-version }}"
44+
OUTPUT_NODE_VERSION="$VERSION_IDENTIFIER"
45+
46+
if test "$VERSION_IDENTIFIER" == "node-new"
47+
then
48+
OUTPUT_NODE_VERSION="20"
49+
else
50+
if test "$VERSION_IDENTIFIER" == "node-old" || test "$VERSION_IDENTIFIER" == "xs"
51+
then
52+
OUTPUT_NODE_VERSION="18"
53+
fi
54+
fi
55+
56+
echo "NODE_VERSION=$OUTPUT_NODE_VERSION" >> "$GITHUB_OUTPUT"
57+
3758
- uses: actions/checkout@v4
3859
with:
3960
clean: false
@@ -118,7 +139,7 @@ runs:
118139

119140
- uses: actions/setup-node@v4
120141
with:
121-
node-version: ${{ inputs.node-version }}
142+
node-version: ${{ steps.set-node-version.outputs.NODE_VERSION }}
122143
cache: yarn
123144
cache-dependency-path: |
124145
${{ inputs.path }}/yarn.lock
@@ -132,7 +153,7 @@ runs:
132153
uses: actions/cache@v4
133154
with:
134155
path: ${{ inputs.path }}
135-
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.release }}-node-${{ inputs.node-version }}-built-${{ inputs.xsnap-random-init }}-${{ github.sha }}-${{ steps.endo-sha.outputs.sha }}
156+
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.release }}-node-${{ steps.set-node-version.outputs.NODE_VERSION }}-built-${{ inputs.xsnap-random-init }}-${{ github.sha }}-${{ steps.endo-sha.outputs.sha }}
136157

137158
# This and the git diff below are to detect if `yarn install` results in a
138159
# change to the lock file.

.github/workflows/after-merge.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
node-version: ['18.x', '20.x']
19+
node-version: ['node-new', 'node-old']
2020
steps:
2121
- uses: actions/checkout@v4
2222
with:
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
matrix:
4141
# note: only use one node-version
42-
node-version: ['18.x']
42+
node-version: ['node-old']
4343
steps:
4444
- uses: actions/checkout@v4
4545
- uses: ./.github/actions/restore-node
@@ -97,7 +97,7 @@ jobs:
9797
strategy:
9898
matrix:
9999
# note: only use one node-version
100-
node-version: ['18.x']
100+
node-version: ['node-old']
101101
if: ${{github.event_name == 'push' }}
102102
steps:
103103
- uses: actions/checkout@v4
@@ -139,7 +139,7 @@ jobs:
139139
strategy:
140140
matrix:
141141
# note: only use one node-version
142-
node-version: ['18.x']
142+
node-version: ['node-old']
143143
if: ${{github.event_name == 'push'}}
144144
steps:
145145
- uses: actions/checkout@v4

.github/workflows/benchmarks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v4
2222
- uses: ./.github/actions/restore-node
2323
with:
24-
node-version: '18.x'
24+
node-version: 'node-old'
2525

2626
- name: yarn bench (boot)
2727
shell: bash

.github/workflows/integration.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,16 @@ jobs:
259259
working-directory: packages/deployment
260260
- uses: ./.github/actions/restore-node
261261
with:
262-
node-version: '18.x'
263262
# Rebuilding the SDK image with resolved endo packages is not currently supported
264263
# and since we can't build core eval submissions from the SDK using a newer endo,
265264
# simply ignore any endo branch integration (this means we don't have full coverage)
266265
ignore-endo-branch: 'true'
267-
id: restore-node
266+
node-version: 'node-old'
267+
path: ./agoric-sdk
268+
# Forces xsnap to initialize all memory to random data, which increases
269+
# the chances the content of snapshots may deviate between validators
270+
xsnap-random-init: '1'
271+
268272
- name: setup a3p-integration
269273
run: yarn install
270274
working-directory: a3p-integration

.github/workflows/multichain-e2e-template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- uses: ./agoric-sdk/.github/actions/restore-node
3131
with:
32-
node-version: 18.x
32+
node-version: 'node-old'
3333
path: ./agoric-sdk
3434

3535
# Extract chain and relayer information

0 commit comments

Comments
 (0)