|
| 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