Skip to content

Commit 41c17de

Browse files
committed
chore: build and test separated
1 parent c1c6abd commit 41c17de

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/docker/Dockerfile.glibc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ARG UBUNTU_VERSION=bionic
22
FROM ubuntu:${UBUNTU_VERSION} AS build
33

4-
# Possible values: s390x, arm64, x64
54
ARG NODE_VERSION=16.20.1
5+
# Possible values: s390x, arm64, x64
66
ARG NODE_ARCH
77
ADD https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz /
88
RUN mkdir -p /nodejs && tar -xzf /node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz --strip-components=1 -C /nodejs
@@ -13,7 +13,10 @@ COPY . .
1313

1414
RUN apt-get -qq update && apt-get -qq install -y python3 build-essential && ldd --version
1515

16-
RUN npm run install:libmongocrypt && npm run test
16+
RUN npm run install:libmongocrypt
17+
18+
ARG RUN_TEST
19+
RUN [ -n "$RUN_TEST" ] && npm run test || echo 'skipping testing!'
1720

1821
FROM scratch
1922

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch: {}
55
workflow_call: {}
66

7-
name: Build and Test
7+
name: Build
88

99
permissions:
1010
contents: write
@@ -24,10 +24,6 @@ jobs:
2424
run: node .github/scripts/libmongocrypt.mjs ${{ runner.os == 'Windows' && '--build' || '' }}
2525
shell: bash
2626

27-
- name: Test ${{ matrix.os }}
28-
shell: bash
29-
run: npm run test
30-
3127
- id: upload
3228
name: Upload prebuild
3329
uses: actions/upload-artifact@v4
@@ -57,7 +53,12 @@ jobs:
5753
- name: Run Buildx
5854
run: |
5955
docker buildx create --name builder --bootstrap --use
60-
docker buildx build --platform linux/${{ matrix.linux_arch }} --build-arg NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }} --output type=local,dest=./prebuilds,platform-split=false -f ./.github/docker/Dockerfile.glibc .
56+
docker buildx build \
57+
--platform linux/${{ matrix.linux_arch }} \
58+
--build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
59+
--output type=local,dest=./prebuilds,platform-split=false \
60+
-f ./.github/docker/Dockerfile.glibc \
61+
.
6162
6263
- id: upload
6364
name: Upload prebuild

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [main]
66
workflow_dispatch: {}
77

8-
name: Test Node.js Matrix
8+
name: Test
99

1010
jobs:
1111
host_tests:
@@ -65,6 +65,7 @@ jobs:
6565
--build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
6666
--build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
6767
--build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \
68+
--build-arg="RUN_TEST=true" \
6869
--output type=local,dest=./prebuilds,platform-split=false \
6970
-f ./.github/docker/Dockerfile.glibc \
7071
.

0 commit comments

Comments
 (0)