Skip to content

Commit

Permalink
chore: add testing to native SSL hooks (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Jun 26, 2024
1 parent 5875c3f commit 2b1e462
Show file tree
Hide file tree
Showing 5 changed files with 6,255 additions and 26 deletions.
5 changes: 3 additions & 2 deletions .github/docker/Dockerfile.glibc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM ubuntu:bionic AS build

# Possible values: s390x, arm64, x64
ARG NODE_VERSION=16.20.1
ARG NODE_ARCH
ADD https://nodejs.org/dist/v16.20.1/node-v16.20.1-linux-${NODE_ARCH}.tar.gz /
RUN mkdir -p /nodejs && tar -xzf /node-v16.20.1-linux-${NODE_ARCH}.tar.gz --strip-components=1 -C /nodejs
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 /mongodb-client-encryption
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}

name: Test Node.js Matrix

jobs:
host_tests:
strategy:
matrix:
os: [macos-latest, windows-2019]
node: [16.x, 18.x, 20.x, 22.x]
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: Build with Node.js ${{ matrix.node }} on ${{ matrix.os }}
run: node .github/scripts/libmongocrypt.mjs ${{ runner.os == 'Windows' && '--build' || '' }}
shell: bash

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

container_tests:
runs-on: ubuntu-latest
strategy:
matrix:
linux_arch: [s390x, arm64, amd64]
node: [16.x, 18.x, 20.x, 22.x]
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"
- 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 }} \
--output type=local,dest=./prebuilds,platform-split=false \
-f ./.github/docker/Dockerfile.glibc \
.
Loading

0 comments on commit 2b1e462

Please sign in to comment.