|
| 1 | +on: |
| 2 | + pull_request: |
| 3 | + branches: [main] |
| 4 | + workflow_dispatch: {} |
| 5 | + workflow_call: {} |
| 6 | + |
| 7 | +name: Build and Test |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + pull-requests: write |
| 12 | + id-token: write |
| 13 | + |
| 14 | +jobs: |
| 15 | + check_docs: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Install dependencies |
| 21 | + run: node install --ignore-scripts |
| 22 | + |
| 23 | + - name: Build and check docs |
| 24 | + run: | |
| 25 | + npm run docs |
| 26 | + if ! git diff --quiet README.md ; then |
| 27 | + echo "Generated readme is out-of-sync! Please update the readme and re-commit, modifying the template in etc/README.hbs if necessary." |
| 28 | + exit 1 |
| 29 | + fi |
| 30 | +
|
| 31 | + container_builds: |
| 32 | + outputs: |
| 33 | + artifact_id: ${{ steps.upload.outputs.artifact-id }} |
| 34 | + runs-on: ubuntu-latest |
| 35 | + strategy: |
| 36 | + matrix: |
| 37 | + linux_arch: [s390x, arm64, amd64] |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Set up QEMU |
| 42 | + uses: docker/setup-qemu-action@v3 |
| 43 | + |
| 44 | + - name: Set up Docker Buildx |
| 45 | + uses: docker/setup-buildx-action@v3 |
| 46 | + |
| 47 | + - name: Run Buildx |
| 48 | + run: | |
| 49 | + docker buildx create --name builder --bootstrap --use |
| 50 | + 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 . |
| 51 | +
|
| 52 | + - id: upload |
| 53 | + name: Upload prebuild |
| 54 | + uses: actions/upload-artifact@v4 |
| 55 | + with: |
| 56 | + name: build-linux-${{ matrix.linux_arch }} |
| 57 | + path: prebuilds/ |
| 58 | + if-no-files-found: 'error' |
| 59 | + retention-days: 1 |
| 60 | + compression-level: 0 |
| 61 | + |
| 62 | + freebsd_builds: |
| 63 | + runs-on: ubuntu-latest |
| 64 | + strategy: |
| 65 | + matrix: |
| 66 | + freebsd_arch: [aarch64, amd64] |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + |
| 70 | + - name: Build freebsd-${{ matrix.freebsd_arch }} Prebuild |
| 71 | + uses: vmactions/freebsd-vm@v1 |
| 72 | + with: |
| 73 | + arch: ${{ matrix.freebsd_arch }} |
| 74 | + usesh: true |
| 75 | + prepare: | |
| 76 | + pkg install -y krb5 node npm pkgconf |
| 77 | + run: | |
| 78 | + node .github/scripts/build.mjs |
| 79 | +
|
| 80 | + - id: upload |
| 81 | + name: Upload prebuild |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: build-freebsd-${{ matrix.freebsd_arch }} |
| 85 | + path: prebuilds/ |
| 86 | + if-no-files-found: 'error' |
| 87 | + retention-days: 1 |
| 88 | + compression-level: 0 |
0 commit comments