Skip to content

Commit 2b1e462

Browse files
authored
chore: add testing to native SSL hooks (#31)
1 parent 5875c3f commit 2b1e462

File tree

5 files changed

+6255
-26
lines changed

5 files changed

+6255
-26
lines changed

.github/docker/Dockerfile.glibc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
FROM ubuntu:bionic AS build
22

33
# Possible values: s390x, arm64, x64
4+
ARG NODE_VERSION=16.20.1
45
ARG NODE_ARCH
5-
ADD https://nodejs.org/dist/v16.20.1/node-v16.20.1-linux-${NODE_ARCH}.tar.gz /
6-
RUN mkdir -p /nodejs && tar -xzf /node-v16.20.1-linux-${NODE_ARCH}.tar.gz --strip-components=1 -C /nodejs
6+
ADD https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz /
7+
RUN mkdir -p /nodejs && tar -xzf /node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz --strip-components=1 -C /nodejs
78
ENV PATH=$PATH:/nodejs/bin
89

910
WORKDIR /mongodb-client-encryption

.github/workflows/test.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch: {}
7+
8+
name: Test Node.js Matrix
9+
10+
jobs:
11+
host_tests:
12+
strategy:
13+
matrix:
14+
os: [macos-latest, windows-2019]
15+
node: [16.x, 18.x, 20.x, 22.x]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node }}
23+
cache: 'npm'
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Build with Node.js ${{ matrix.node }} on ${{ matrix.os }}
27+
run: node .github/scripts/libmongocrypt.mjs ${{ runner.os == 'Windows' && '--build' || '' }}
28+
shell: bash
29+
30+
- name: Test ${{ matrix.os }}
31+
shell: bash
32+
run: npm run test
33+
34+
container_tests:
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
linux_arch: [s390x, arm64, amd64]
39+
node: [16.x, 18.x, 20.x, 22.x]
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: ${{ matrix.node }}
46+
47+
- name: Get Full Node.js Version
48+
id: get_nodejs_version
49+
shell: bash
50+
run: |
51+
echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT"
52+
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v3
55+
56+
- name: Set up Docker Buildx
57+
uses: docker/setup-buildx-action@v3
58+
59+
- name: Run Buildx
60+
run: |
61+
docker buildx create --name builder --bootstrap --use
62+
docker buildx build \
63+
--platform linux/${{ matrix.linux_arch }} \
64+
--build-arg NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }} \
65+
--build-arg NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }} \
66+
--output type=local,dest=./prebuilds,platform-split=false \
67+
-f ./.github/docker/Dockerfile.glibc \
68+
.

0 commit comments

Comments
 (0)