Skip to content

Commit c123b59

Browse files
authored
Add s390x cpu support to install.js and CI (#412)
1 parent bcb5053 commit c123b59

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,51 @@ jobs:
109109
echo "Binary not found at $BIN"
110110
exit 1
111111
fi
112+
113+
build_s390x:
114+
name: Build s390x
115+
runs-on: ubuntu-latest
116+
strategy:
117+
fail-fast: false
118+
matrix:
119+
node: ["16", "18", "19", "20"]
120+
steps:
121+
- uses: actions/checkout@v2
122+
- uses: uraimo/run-on-arch-action@v2.1.1
123+
name: Verify install
124+
id: build
125+
with:
126+
arch: s390x
127+
distro: ubuntu20.04
128+
env: | # this is just so we can cache each version
129+
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}-${{ matrix.node }}
130+
dockerRunArgs: |
131+
--volume "$PWD:/app"
132+
githubToken: ${{ github.token }}
133+
install: |
134+
set -euo pipefail
135+
apt-get update
136+
apt-get -y install xz-utils curl libnss3
137+
curl -fsSL --output sha https://nodejs.org/dist/latest-v${{ matrix.node }}.x/SHASUMS256.txt
138+
FULL_FILE=`grep 'node-v${{ matrix.node }}.*-linux-s390x.tar.gz' sha | tr -s ' ' | cut -d' ' -f2`
139+
NODE_VERSION=`echo $FULL_FILE | grep --color=never -Eo '[0-9]{2,}\.[0-9]{1,}\.[0-9]{1,}'`
140+
echo "Node version is $NODE_VERSION"
141+
ARCH=s390x
142+
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz"
143+
tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner
144+
rm sha
145+
rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz"
146+
npm install -g npm@latest
147+
run: |
148+
node --version
149+
npm --version
150+
cd /app
151+
npm ci --no-progress
152+
BIN="./lib/chromedriver/chromedriver"
153+
if ! [ -e $BIN ]; then
154+
echo "Binary not found at $BIN"
155+
exit 1
156+
fi
112157
113158
build_proxy:
114159
name: Build with proxy
@@ -141,7 +186,7 @@ jobs:
141186
publish:
142187
name: Publish to npm
143188
runs-on: ubuntu-latest
144-
needs: [build, build_arm64, build_proxy]
189+
needs: [build, build_arm64, build_s390x, build_proxy]
145190
if: success() && startsWith(github.ref, 'refs/tags/')
146191
steps:
147192
- uses: actions/checkout@v2

install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function validatePlatform() {
8383
/** @type string */
8484
let thePlatform = process.platform;
8585
if (thePlatform === 'linux') {
86-
if (process.arch === 'arm64' || process.arch === 'x64') {
86+
if (process.arch === 'arm64' || process.arch === 's390x' || process.arch === 'x64') {
8787
thePlatform += '64';
8888
} else {
8989
console.log('Only Linux 64 bits supported.');

0 commit comments

Comments
 (0)