Skip to content

Commit 4812548

Browse files
committed
GHA: Handle removal of Node 16
Download an unofficial Node 20 build against glibc 2.17
1 parent 124439c commit 4812548

1 file changed

Lines changed: 10 additions & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ jobs:
100100

101101
timeout-minutes: 120
102102
runs-on: ${{matrix.os}}
103-
container: ${{matrix.container}}
103+
container:
104+
image: ${{matrix.container}}
105+
volumes:
106+
- /node20217:/node20217:rw,rshared
107+
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
104108
env: {B2_USE_CCACHE: 1}
105109

106110
steps:
@@ -132,59 +136,29 @@ jobs:
132136
echo "B2_USE_CCACHE=0" >> $GITHUB_ENV
133137
fi
134138
git config --global pack.threads 0
135-
! command -v cmake &> /dev/null || echo "B2_FLAGS=--nowide-enable-cmake" >> $GITHUB_ENV
136-
137-
if [[ "${{matrix.container}}" == "ubuntu:16.04" ]] || [[ "${{matrix.container}}" == "ubuntu:18.04" ]]; then
138-
# Ubuntu 16/18 can't run Node 20, so stick to older actions: https://github.com/actions/checkout/issues/1590
139-
echo "GHA_USE_NODE_20=false" >> $GITHUB_ENV
140-
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
141-
else
142-
echo "GHA_USE_NODE_20=true" >> $GITHUB_ENV
139+
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
140+
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
141+
curl -sL https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -x --strip-components 1 -C /node20217
143142
fi
144-
145-
- uses: actions/checkout@v3
146-
if: env.GHA_USE_NODE_20 == 'false'
147-
with:
148-
# For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
149-
fetch-depth: ${{ matrix.coverage && '0' || '1' }}
143+
! command -v cmake &> /dev/null || echo "B2_FLAGS=--nowide-enable-cmake" >> $GITHUB_ENV
150144
151145
- uses: actions/checkout@v4
152-
if: env.GHA_USE_NODE_20 == 'true'
153146
with:
154147
# For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
155148
fetch-depth: ${{ matrix.coverage && '0' || '1' }}
156149

157-
- name: Cache ccache
158-
uses: actions/cache@v3
159-
if: env.B2_USE_CCACHE && env.GHA_USE_NODE_20 == 'false'
160-
with:
161-
path: ~/.ccache
162-
key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}}
163-
restore-keys: |
164-
${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
165-
${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}
166-
167150
- name: Cache ccache
168151
uses: actions/cache@v4
169-
if: env.B2_USE_CCACHE && env.GHA_USE_NODE_20 == 'true'
152+
if: env.B2_USE_CCACHE
170153
with:
171154
path: ~/.ccache
172155
key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}}
173156
restore-keys: |
174157
${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
175158
${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}
176159
177-
- name: Fetch Boost.CI
178-
uses: actions/checkout@v3
179-
if: env.GHA_USE_NODE_20 == 'false'
180-
with:
181-
repository: boostorg/boost-ci
182-
ref: master
183-
path: boost-ci-cloned
184-
185160
- name: Fetch Boost.CI
186161
uses: actions/checkout@v4
187-
if: env.GHA_USE_NODE_20 == 'true'
188162
with:
189163
repository: boostorg/boost-ci
190164
ref: master

0 commit comments

Comments
 (0)