Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mongodb-js/zstd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8b1b9e6d7910049a6fcfb2893d38f3c13360398f
Choose a base ref
..
head repository: mongodb-js/zstd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5e9ab8e4ad8254d5cbc57fd1703ae7f8effb9ac7
Choose a head ref
Showing with 84 additions and 85 deletions.
  1. +69 −71 .github/workflows/test.yml
  2. +15 −14 etc/docker.sh
140 changes: 69 additions & 71 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,82 +8,80 @@ on:
name: Test

jobs:
# host_tests:
# strategy:
# matrix:
# os: [macos-latest, windows-2019]
# node: [16.20.1, 18.x, 20.x, 22.x]
# fail-fast: false
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4

# - uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}
# cache: 'npm'
# registry-url: 'https://registry.npmjs.org'

# - name: Install zstd
# run: npm run install-zstd
# shell: bash

# - name: install dependencies and compmile
# run: npm install --loglevel verbose
# shell: bash

# - name: Test ${{ matrix.os }}
# shell: bash
# run: npm test

# # container_tests:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# linux_arch: [s390x, arm64, amd64]
# node: [16.x, 18.x, 20.x, 22.x]
# fail-fast: false
# steps:
# - uses: actions/checkout@v4

# - uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}

# - name: Get Full Node.js Version
# id: get_nodejs_version
# shell: bash
# run: |
# echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT"
# echo "ubuntu_version=$(node --print '(+process.version.slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`')" >> "$GITHUB_OUTPUT"

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Run Buildx
# run: |
# docker buildx create --name builder --bootstrap --use
# docker buildx build \
# --platform linux/${{ matrix.linux_arch }} \
# --build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
# --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
# --build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \
# --build-arg="RUN_TEST=true" \
# --output type=local,dest=./prebuilds,platform-split=false \
# -f ./.github/docker/Dockerfile.glibc \
# .


host_tests:
strategy:
matrix:
os: [macos-latest, windows-2019]
node: [16.20.1, 18.x, 20.x, 22.x]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install zstd
run: npm run install-zstd
shell: bash

- name: install dependencies and compmile
run: npm install --loglevel verbose
shell: bash

- name: Test ${{ matrix.os }}
shell: bash
run: npm test

container_tests_glibc:
runs-on: ubuntu-latest
strategy:
matrix:
linux_arch: [s390x, arm64, amd64]
node: [16.x, 18.x, 20.x, 22.x]
fail-fast: false
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Get Full Node.js Version
id: get_nodejs_version
shell: bash
run: |
echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT"
echo "ubuntu_version=$(node --print '(+process.version.slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`')" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run Buildx
run: |
docker buildx create --name builder --bootstrap --use
docker buildx build \
--platform linux/${{ matrix.linux_arch }} \
--build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
--build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
--build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \
--build-arg="RUN_TEST=true" \
--output type=local,dest=./prebuilds,platform-split=false \
-f ./.github/docker/Dockerfile.glibc \
.
container_tests_musl:
runs-on: ubuntu-latest
strategy:
matrix:
linux_arch: [arm64v8, amd64]
# node: [16.x, 18.x, 20.x, 22.x]
node: [16.x]
node: [16.20.1, 18.x, 20.x, 22.x]
fail-fast: false
steps:
- uses: actions/checkout@v4
29 changes: 15 additions & 14 deletions etc/docker.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# # docker buildx create --name builder --bootstrap --use
# docker --debug buildx build --progress=plain --no-cache \
# --platform linux/amd64 --output type=local,dest=./prebuilds,platform-split=false \
# --build-arg="P=amd64" \
# -f ./Dockerfile.musl \
# .

# s390x, arm64, amd64
#! /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
@@ -14,17 +13,19 @@ NODE_VERSION=16.20.1
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
PROJECT_DIR=$SCRIPT_DIR/..

musl() {
build_and_test_musl() {
docker buildx create --name builder --bootstrap --use

docker --debug buildx build --load --progress=plain --no-cache \
--platform linux/arm64v8 --output=type=docker \
--build-arg="PLATFORM=arm64v8" \
--build-arg="NODE_VERSION=16.20.1" \
--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 \
.
}

glibc() {
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)
@@ -41,4 +42,4 @@ glibc() {
$PROJECT_DIR
}

musl