|
| 1 | +name: Check Node packages |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + |
| 9 | +jobs: |
| 10 | + version: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v7 |
| 14 | + - uses: actions/setup-python@v7 |
| 15 | + with: |
| 16 | + python-version: "3.12" |
| 17 | + - run: python tests/check_release_version.py |
| 18 | + |
| 19 | + build: |
| 20 | + needs: version |
| 21 | + runs-on: ${{ matrix.host }} |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + include: |
| 26 | + - host: windows-latest |
| 27 | + target: x86_64-pc-windows-msvc |
| 28 | + flags: "" |
| 29 | + - host: windows-11-arm |
| 30 | + target: aarch64-pc-windows-msvc |
| 31 | + flags: "" |
| 32 | + - host: macos-15-intel |
| 33 | + target: x86_64-apple-darwin |
| 34 | + flags: "" |
| 35 | + - host: macos-latest |
| 36 | + target: aarch64-apple-darwin |
| 37 | + flags: "" |
| 38 | + - host: ubuntu-latest |
| 39 | + target: x86_64-unknown-linux-gnu |
| 40 | + flags: --use-napi-cross |
| 41 | + - host: ubuntu-latest |
| 42 | + target: aarch64-unknown-linux-gnu |
| 43 | + flags: --use-napi-cross |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v7 |
| 46 | + - uses: actions/setup-node@v7 |
| 47 | + with: |
| 48 | + node-version: "24" |
| 49 | + cache: npm |
| 50 | + cache-dependency-path: node/package-lock.json |
| 51 | + - uses: dtolnay/rust-toolchain@stable |
| 52 | + with: |
| 53 | + targets: ${{ matrix.target }} |
| 54 | + - run: npm ci |
| 55 | + working-directory: node |
| 56 | + - name: Build native binding and loader |
| 57 | + working-directory: node |
| 58 | + run: npm run build -- --target ${{ matrix.target }} ${{ matrix.flags }} -- --locked |
| 59 | + - uses: actions/upload-artifact@v7 |
| 60 | + with: |
| 61 | + name: bindings-${{ matrix.target }} |
| 62 | + path: | |
| 63 | + node/geddes.*.node |
| 64 | + node/index.js |
| 65 | + node/index.d.ts |
| 66 | + if-no-files-found: error |
| 67 | + |
| 68 | + pack: |
| 69 | + needs: build |
| 70 | + runs-on: ubuntu-latest |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v7 |
| 73 | + - uses: actions/setup-node@v7 |
| 74 | + with: |
| 75 | + node-version: "24" |
| 76 | + cache: npm |
| 77 | + cache-dependency-path: node/package-lock.json |
| 78 | + - run: npm ci |
| 79 | + working-directory: node |
| 80 | + - uses: actions/download-artifact@v8 |
| 81 | + with: |
| 82 | + pattern: bindings-* |
| 83 | + path: node/artifacts |
| 84 | + - name: Pack the JS package and all native packages |
| 85 | + working-directory: node |
| 86 | + run: npm run pack:release -- artifacts packages |
| 87 | + - uses: actions/upload-artifact@v7 |
| 88 | + with: |
| 89 | + name: node-packages |
| 90 | + path: node/packages/* |
| 91 | + if-no-files-found: error |
| 92 | + |
| 93 | + install-test: |
| 94 | + needs: pack |
| 95 | + runs-on: ${{ matrix.host }} |
| 96 | + strategy: |
| 97 | + fail-fast: false |
| 98 | + matrix: |
| 99 | + host: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest, windows-latest, windows-11-arm] |
| 100 | + node-version: ["16", "24"] |
| 101 | + exclude: |
| 102 | + - host: windows-11-arm |
| 103 | + node-version: "16" |
| 104 | + include: |
| 105 | + # Node 16 has no Windows ARM64 distribution. |
| 106 | + - host: windows-11-arm |
| 107 | + node-version: "20" |
| 108 | + steps: |
| 109 | + - uses: actions/checkout@v7 |
| 110 | + - uses: actions/setup-node@v7 |
| 111 | + with: |
| 112 | + node-version: ${{ matrix.node-version }} |
| 113 | + - uses: actions/download-artifact@v8 |
| 114 | + with: |
| 115 | + name: node-packages |
| 116 | + path: node/packages |
| 117 | + - name: Install tarballs and test the public loader |
| 118 | + working-directory: node |
| 119 | + run: npm run check:package -- packages |
0 commit comments