Skip to content

Commit 419ebcc

Browse files
...test?
1 parent 6c5b389 commit 419ebcc

File tree

5 files changed

+59
-31
lines changed

5 files changed

+59
-31
lines changed

.github/docker/Dockerfile.glibc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ ENV PATH=$PATH:/nodejs/bin
1111
WORKDIR /mongodb-client-encryption
1212
COPY . .
1313

14-
RUN apt-get -qq update && apt-get -qq install -y python3 build-essential git && ldd --version
14+
RUN apt-get -qq update && apt-get -qq install -y build-essential curl git && ldd --version
1515

16-
RUN npm run install:libmongocrypt
17-
18-
ARG RUN_TEST
19-
RUN if [ -n "$RUN_TEST" ]; then npm test ; else echo "skipping tests" ; fi
20-
21-
FROM scratch
22-
23-
COPY --from=build /mongodb-client-encryption/prebuilds/ /
16+
RUN bash install-pyenv.sh
17+
RUN pyenv install 3.10 && pyenv global 3.10
18+
RUN python --version
19+
RUN git --version
20+
RUN c++ --version
21+
RUN g++ --version

.github/docker/Dockerfile.musl

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
ARG PLATFORM=arm64
1+
ARG ARCH=arm64
22
ARG NODE_VERSION=16.20.1
33

4-
FROM ${PLATFORM}/node:${NODE_VERSION}-alpine AS build
5-
6-
WORKDIR /mongodb-client-encryption
7-
COPY . .
4+
FROM ${ARCH}/node:${NODE_VERSION}-alpine AS dependencies
85

96
RUN apk --no-cache add make g++ libc-dev curl bash python3 py3-pip cmake git
10-
RUN npm run install:libmongocrypt
11-
RUN npm run prebuild
12-
13-
ARG RUN_TEST
14-
RUN if [ -n "$RUN_TEST" ]; then npm test ; else echo "skipping tests" ; fi
15-
16-
FROM scratch
177

18-
COPY --from=build /mongodb-client-encryption/prebuilds/ /
8+
RUN python3 --version
9+
RUN git --version
10+
RUN c++ --version
11+
RUN g++ --version

.github/docker/Test.dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG ARCH
2+
ARG NODE_VERSION
3+
FROM ${ARCH}-alpine-base-node-${NODE_VERSION}:latest
4+
5+
WORKDIR /mongodb-client-encryption
6+
COPY . .
7+
8+
RUN npm install --ignore-scripts
9+
RUN npm run install:libmongocrypt -- --skip-bindings

.github/workflows/test.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,29 @@ jobs:
109109
version: v0.18.0
110110
driver-opts: image=moby/buildkit:v0.17.2
111111

112+
- name: Init builder
113+
run: docker buildx create --name builder --bootstrap --use
114+
112115
- name: Run Buildx
113116
run: |
114-
docker buildx create --name builder --bootstrap --use
117+
ARCH=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}
118+
NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}
119+
TAG=$ARCH-alpine-lib-base-node-$NODE_VERSION
115120
docker --debug buildx build --progress=plain --no-cache \
116121
--platform linux/${{ matrix.linux_arch }} \
117-
--build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \
122+
--build-arg="ARCH=$ARCH" \
118123
--build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
119-
--build-arg="RUN_TEST=true" \
120-
--output type=local,dest=./prebuilds,platform-split=false \
124+
--output type=oci,dest=alpine-node-base,platform-split=false \
121125
-f ./.github/docker/Dockerfile.musl \
122-
.
126+
-t $ARCH-alpine-lib-base-node-$NODE_VERSION
127+
.
128+
129+
- id: upload
130+
name: Upload prebuild
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: ${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}-alpine-lib-base-node-${{ steps.get_nodejs_version.outputs.version }}
134+
path: alpine-node-base
135+
if-no-files-found: 'error'
136+
retention-days: 30
137+
compression-level: 0

etc/docker.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,28 @@ NODE_VERSION=20.0.0
1313
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
1414
PROJECT_DIR=$SCRIPT_DIR/..
1515

16+
# set -o xtrace
17+
1618
build_and_test_musl() {
1719
docker buildx create --name builder --bootstrap --use
1820

19-
docker --debug buildx build --load --progress=plain --no-cache \
20-
--platform linux/$LINUX_ARCH --output=type=docker \
21+
BASE_TAG=$LINUX_ARCH-alpine-base-node-$NODE_VERSION
22+
docker --debug buildx build --progress=plain \
23+
--platform linux/$LINUX_ARCH --output=type=oci,dest=alpine-lib-base \
2124
--build-arg="PLATFORM=$LINUX_ARCH" \
2225
--build-arg="NODE_VERSION=$NODE_VERSION" \
2326
--build-arg="RUN_TEST=true" \
24-
-f ./.github/docker/Dockerfile.musl -t musl-zstd-base \
27+
-f ./.github/docker/Dockerfile.musl -t $BASE_TAG \
28+
.
29+
30+
cat alpine-lib-base | docker load
31+
32+
LIBMONGOCRYPT_TAG=$LINUX_ARCH-alpine-libmongocrypt-node-$NODE_VERSION
33+
docker --debug buildx build --progress=plain --pull=false --no-cache \
34+
--platform linux/$LINUX_ARCH --load \
35+
--build-arg="ARCH=$LINUX_ARCH" \
36+
--build-arg="NODE_VERSION=$NODE_VERSION" \
37+
-f ./.github/docker/Test.dockerfile -t $LIBMONGOCRYPT_TAG \
2538
.
2639
}
2740

@@ -42,5 +55,5 @@ build_and_test_glibc() {
4255
$PROJECT_DIR
4356
}
4457

45-
build_and_test_musl
58+
# build_and_test_musl
4659
# build_and_test_glibc

0 commit comments

Comments
 (0)