-
Notifications
You must be signed in to change notification settings - Fork 12
ci(NODE-6570): Test on all supported platforms and Node versions #33
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #ifndef MONGODB_ZSTD_COMPRESSION | ||
| #define MONGODB_ZSTD_COMPRESSION | ||
|
|
||
| #include <exception> | ||
| #include <stdexcept> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was actually the wrong include. |
||
| #include <vector> | ||
|
|
||
| #include "compression_worker.h" | ||
|
|
||
This file contains hidden or 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 hidden or 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to remove, but this is a handy script to run our tests locally in linux containers. |
||
| # 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.