Skip to content

Commit d6ccde9

Browse files
committed
GHA: Install unofficial Node 20 for Ubuntu 16 & 18 containers
1 parent dd23abf commit d6ccde9

1 file changed

Lines changed: 9 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ jobs:
112112

113113
timeout-minutes: 120
114114
runs-on: ${{matrix.os}}
115-
container: ${{matrix.container}}
115+
container:
116+
image: ${{matrix.container}}
117+
volumes:
118+
- /node20217:/node20217:rw,rshared
119+
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
116120
env: {B2_USE_CCACHE: 1}
117121

118122
steps:
@@ -144,52 +148,26 @@ jobs:
144148
echo "B2_USE_CCACHE=0" >> $GITHUB_ENV
145149
fi
146150
git config --global pack.threads 0
147-
if [[ "${{matrix.container}}" == "ubuntu:16.04" ]] || [[ "${{matrix.container}}" == "ubuntu:18.04" ]]; then
148-
# Ubuntu 16/18 can't run Node 20, so stick to older actions: https://github.com/actions/checkout/issues/1590
149-
echo "GHA_USE_NODE_20=false" >> $GITHUB_ENV
150-
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
151-
else
152-
echo "GHA_USE_NODE_20=true" >> $GITHUB_ENV
151+
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
152+
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
153+
curl -sL https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217
153154
fi
154155
155-
- uses: actions/checkout@v3
156-
if: env.GHA_USE_NODE_20 == 'false'
157-
with:
158-
# For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
159-
fetch-depth: ${{ matrix.coverage && '0' || '1' }}
160156
- uses: actions/checkout@v4
161-
if: env.GHA_USE_NODE_20 == 'true'
162157
with:
163158
# For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
164159
fetch-depth: ${{ matrix.coverage && '0' || '1' }}
165160

166-
- name: Cache ccache
167-
uses: actions/cache@v3
168-
if: env.B2_USE_CCACHE && env.GHA_USE_NODE_20 == 'false'
169-
with:
170-
path: ~/.ccache
171-
key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}}
172-
restore-keys: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
173-
174161
- name: Cache ccache
175162
uses: actions/cache@v4
176-
if: env.B2_USE_CCACHE && env.GHA_USE_NODE_20 == 'true'
163+
if: env.B2_USE_CCACHE
177164
with:
178165
path: ~/.ccache
179166
key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}}
180167
restore-keys: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
181168

182-
- name: Fetch Boost.CI
183-
uses: actions/checkout@v3
184-
if: env.GHA_USE_NODE_20 == 'false'
185-
with:
186-
repository: boostorg/boost-ci
187-
ref: master
188-
path: boost-ci-cloned
189-
190169
- name: Fetch Boost.CI
191170
uses: actions/checkout@v4
192-
if: env.GHA_USE_NODE_20 == 'true'
193171
with:
194172
repository: boostorg/boost-ci
195173
ref: master

0 commit comments

Comments
 (0)