-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(NODE-6570): Test on all supported platforms and Node versions (#33)
- Loading branch information
1 parent
3145388
commit ec32fbe
Showing
12 changed files
with
7,594 additions
and
1,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ARG UBUNTU_VERSION=bionic | ||
FROM ubuntu:${UBUNTU_VERSION} AS build | ||
|
||
ARG NODE_VERSION=16.20.1 | ||
# Possible values: s390x, arm64, x64 | ||
ARG NODE_ARCH | ||
ADD https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz / | ||
RUN mkdir -p /nodejs && tar -xzf /node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz --strip-components=1 -C /nodejs | ||
ENV PATH=$PATH:/nodejs/bin | ||
|
||
WORKDIR /zstd | ||
COPY . . | ||
|
||
RUN apt-get -qq update | ||
RUN apt-get -qq install -y python3 build-essential curl cmake | ||
RUN python3 --version | ||
|
||
RUN npm run install-zstd | ||
RUN npm install | ||
|
||
ARG RUN_TEST | ||
RUN if [ -n "$RUN_TEST" ]; then npm test ; else echo "skipping tests" ; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
ARG PLATFORM=arm64 | ||
ARG NODE_VERSION=16.20.1 | ||
|
||
FROM ${PLATFORM}/node:${NODE_VERSION}-alpine AS node | ||
|
||
WORKDIR /zstd | ||
COPY . . | ||
|
||
RUN apk --no-cache add make g++ libc-dev curl bash python3 py3-pip vim cmake | ||
RUN npm run install-zstd && npm i | ||
|
||
ARG RUN_TEST | ||
RUN if [ -n "$RUN_TEST" ]; then npm test ; else echo "skipping tests" ; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ build | |
|
||
npm-debug.log | ||
deps | ||
|
||
prebuilds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
"extension": ["ts"], | ||
"recursive": true, | ||
"failZero": true, | ||
"color": true | ||
"color": true, | ||
"timeout": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#! /bin/bash | ||
|
||
# script to aid in local testing of linux platforms | ||
# requires a running docker instance | ||
|
||
# s390x, arm64, amd64 for ubuntu | ||
# amd64 or arm64v8 for alpine | ||
LINUX_ARCH=arm64 | ||
|
||
# 16.20.1+, default 16.20.1 | ||
NODE_VERSION=18.0.0 | ||
|
||
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0}) | ||
PROJECT_DIR=$SCRIPT_DIR/.. | ||
|
||
build_and_test_musl() { | ||
docker buildx create --name builder --bootstrap --use | ||
|
||
docker --debug buildx build --load --progress=plain --no-cache \ | ||
--platform linux/$LINUX_ARCH --output=type=docker \ | ||
--build-arg="PLATFORM=$LINUX_ARCH" \ | ||
--build-arg="NODE_VERSION=$NODE_VERSION" \ | ||
--build-arg="RUN_TEST=true" \ | ||
-f ./.github/docker/Dockerfile.musl -t musl-zstd-base \ | ||
. | ||
} | ||
|
||
build_and_test_glibc() { | ||
docker buildx create --name builder --bootstrap --use | ||
|
||
UBUNTU_VERSION=ubuntu_version=$(node --print '(process.argv[1].slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`' $NODE_VERSION) | ||
NODE_ARCH=$(node -p 'process.argv[1] === `amd64` && `x64` || process.argv[1]' $LINUX_ARCH) | ||
echo $UBUNTU_VERSION | ||
docker buildx build --progress=plain --no-cache \ | ||
--platform linux/$LINUX_ARCH \ | ||
--build-arg="NODE_ARCH=$NODE_ARCH" \ | ||
--build-arg="NODE_VERSION=$NODE_VERSION" \ | ||
--build-arg="UBUNTU_VERSION$UBUNTU_VERSION" \ | ||
--build-arg="RUN_TEST=true" \ | ||
--output type=local,dest=./prebuilds,platform-split=false \ | ||
-f ./.github/docker/Dockerfile.glibc \ | ||
$PROJECT_DIR | ||
} | ||
|
||
|
||
build_and_test_musl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.