Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add s390x cpu support to install.js and CI #412

Merged
merged 2 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 46 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,51 @@ jobs:
echo "Binary not found at $BIN"
exit 1
fi

build_s390x:
name: Build s390x
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["16", "18", "19", "20"]
steps:
- uses: actions/checkout@v2
- uses: uraimo/run-on-arch-action@v2.1.1
name: Verify install
id: build
with:
arch: s390x
distro: ubuntu20.04
env: | # this is just so we can cache each version
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}-${{ matrix.node }}
dockerRunArgs: |
--volume "$PWD:/app"
githubToken: ${{ github.token }}
install: |
set -euo pipefail
apt-get update
apt-get -y install xz-utils curl libnss3
curl -fsSL --output sha https://nodejs.org/dist/latest-v${{ matrix.node }}.x/SHASUMS256.txt
FULL_FILE=`grep 'node-v${{ matrix.node }}.*-linux-s390x.tar.gz' sha | tr -s ' ' | cut -d' ' -f2`
NODE_VERSION=`echo $FULL_FILE | grep --color=never -Eo '[0-9]{2,}\.[0-9]{1,}\.[0-9]{1,}'`
echo "Node version is $NODE_VERSION"
ARCH=s390x
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz"
tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner
rm sha
rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz"
npm install -g npm@latest
run: |
node --version
npm --version
cd /app
npm ci --no-progress
BIN="./lib/chromedriver/chromedriver"
if ! [ -e $BIN ]; then
echo "Binary not found at $BIN"
exit 1
fi

build_proxy:
name: Build with proxy
Expand Down Expand Up @@ -141,7 +186,7 @@ jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: [build, build_arm64, build_proxy]
needs: [build, build_arm64, build_s390x, build_proxy]
if: success() && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion install.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function validatePlatform() {
/** @type string */
let thePlatform = process.platform;
if (thePlatform === 'linux') {
if (process.arch === 'arm64' || process.arch === 'x64') {
if (process.arch === 'arm64' || process.arch === 's390x' || process.arch === 'x64') {
thePlatform += '64';
} else {
console.log('Only Linux 64 bits supported.');
Expand Down