| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7a17c50 commit 6d11a71
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,89 @@ | |||
| 1 | + name: Build Node.js (shared libraries) | ||
| 2 | + | ||
| 3 | + on: | ||
| 4 | + workflow_call: | ||
| 5 | + inputs: | ||
| 6 | + runner: | ||
| 7 | + description: The runner to use for the job. | ||
| 8 | + required: true | ||
| 9 | + type: string | ||
| 10 | + extra-nix-flags: | ||
| 11 | + description: Additional CLI arguments appended to the nix-shell invocation. | ||
| 12 | + required: false | ||
| 13 | + type: string | ||
| 14 | + default: '' | ||
| 15 | + with-sccache: | ||
| 16 | + description: Whether to enable sccache | ||
| 17 | + required: false | ||
| 18 | + type: boolean | ||
| 19 | + default: false | ||
| 20 | + v8-nar: | ||
| 21 | + description: An optional name for the NAR archive for V8 that needs to be downloaded | ||
| 22 | + required: false | ||
| 23 | + type: string | ||
| 24 | + default: '' | ||
| 25 | + secrets: | ||
| 26 | + CACHIX_AUTH_TOKEN: | ||
| 27 | + description: Cachix auth token for nodejs.cachix.org. | ||
| 28 | + required: false | ||
| 29 | + | ||
| 30 | + permissions: {} | ||
| 31 | + | ||
| 32 | + env: | ||
| 33 | + FLAKY_TESTS: keep_retrying | ||
| 34 | + | ||
| 35 | + jobs: | ||
| 36 | + build: | ||
| 37 | + runs-on: ${{ inputs.runner }} | ||
| 38 | + steps: | ||
| 39 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| 40 | + with: | ||
| 41 | + name: tarballs | ||
| 42 | + path: tarballs | ||
| 43 | + | ||
| 44 | + - name: Extract tarball | ||
| 45 | + shell: bash | ||
| 46 | + run: | | ||
| 47 | + tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP" | ||
| 48 | + echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV" | ||
| 49 | + | ||
| 50 | + - uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6 | ||
| 51 | + with: | ||
| 52 | + extra_nix_config: sandbox = true | ||
| 53 | + | ||
| 54 | + - uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17 | ||
| 55 | + with: | ||
| 56 | + name: nodejs | ||
| 57 | + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| 58 | + | ||
| 59 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| 60 | + if: inputs.v8-nar | ||
| 61 | + with: | ||
| 62 | + name: ${{ inputs.v8-nar }} | ||
| 63 | + | ||
| 64 | + - name: Configure sccache | ||
| 65 | + if: inputs.with-sccache | ||
| 66 | + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | ||
| 67 | + with: | ||
| 68 | + script: | | ||
| 69 | + core.exportVariable('SCCACHE_GHA_ENABLED', 'on'); | ||
| 70 | + core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on'); | ||
| 71 | + core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); | ||
| 72 | + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
| 73 | + core.exportVariable('NIX_SCCACHE', '(import <nixpkgs> {}).sccache'); | ||
| 74 | + | ||
| 75 | + - name: Build Node.js and run tests | ||
| 76 | + shell: bash | ||
| 77 | + run: | | ||
| 78 | + nix-shell \ | ||
| 79 | + -I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \ | ||
| 80 | + --pure --keep TAR_DIR --keep FLAKY_TESTS \ | ||
| 81 | + --keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ | ||
| 82 | + --arg loadJSBuiltinsDynamically false \ | ||
| 83 | + --arg ccache "${NIX_SCCACHE:-null}" \ | ||
| 84 | + --arg devTools '[]' \ | ||
| 85 | + --arg benchmarkTools '[]' \ | ||
| 86 | + ${{ inputs.extra-nix-flags }} \ | ||
| 87 | + --run ' | ||
| 88 | + make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS" | ||
| 89 | + ' "$TAR_DIR/shell.nix" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ on: | |||
| 48 | 48 | - vcbuild.bat | |
| 49 | 49 | - .** | |
| 50 | 50 | - '!.github/workflows/test-shared.yml' | |
| 51 | - - '!.github/actions/build-shared/**' | ||
| 51 | + - '!.github/workflows/build-shared.yml' | ||
| 52 | 52 | types: [opened, synchronize, reopened, ready_for_review] | |
| 53 | 53 | push: | |
| 54 | 54 | branches: | |
@@ -100,15 +100,12 @@ on: | |||
| 100 | 100 | - vcbuild.bat | |
| 101 | 101 | - .** | |
| 102 | 102 | - '!.github/workflows/test-shared.yml' | |
| 103 | - - '!.github/actions/build-shared/**' | ||
| 103 | + - '!.github/workflows/build-shared.yml' | ||
| 104 | 104 | ||
| 105 | 105 | concurrency: | |
| 106 | 106 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| 107 | 107 | cancel-in-progress: true | |
| 108 | 108 | ||
| 109 | - env: | ||
| 110 | - FLAKY_TESTS: keep_retrying | ||
| 111 | - | ||
| 112 | 109 | permissions: | |
| 113 | 110 | contents: read | |
| 114 | 111 | ||
@@ -153,20 +150,15 @@ jobs: | |||
| 153 | 150 | - runner: macos-latest | |
| 154 | 151 | system: aarch64-darwin | |
| 155 | 152 | name: '${{ matrix.system }}: with shared libraries' | |
| 156 | - runs-on: ${{ matrix.runner }} | ||
| 157 | - steps: | ||
| 158 | - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| 159 | - with: | ||
| 160 | - persist-credentials: false | ||
| 161 | - sparse-checkout: .github/actions | ||
| 162 | - sparse-checkout-cone-mode: false | ||
| 163 | - - uses: ./.github/actions/build-shared | ||
| 164 | - name: Build and test Node.js | ||
| 165 | - with: | ||
| 166 | - cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| 167 | - extra-nix-flags: | | ||
| 168 | - --arg useSeparateDerivationForV8 true \ | ||
| 169 | - ${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg withFFI false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }} | ||
| 153 | + uses: ./.github/workflows/build-shared.yml | ||
| 154 | + with: | ||
| 155 | + runner: ${{ matrix.runner }} | ||
| 156 | + with-sccache: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} | ||
| 157 | + extra-nix-flags: | | ||
| 158 | + --arg useSeparateDerivationForV8 true \ | ||
| 159 | + ${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg withFFI false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }} | ||
| 160 | + secrets: | ||
| 161 | + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| 170 | 162 | ||
| 171 | 163 | build-aarch64-linux-v8: | |
| 172 | 164 | needs: build-tarball | |
@@ -249,34 +241,22 @@ jobs: | |||
| 249 | 241 | matrix: | |
| 250 | 242 | openssl: ${{ fromJSON(needs.build-aarch64-linux-v8.outputs.matrix) }} | |
| 251 | 243 | name: 'aarch64-linux: with shared ${{ matrix.openssl.name }}' | |
| 252 | - runs-on: ubuntu-24.04-arm | ||
| 253 | - continue-on-error: false | ||
| 254 | - env: | ||
| 255 | - OPENSSL_ATTR: ${{ matrix.openssl.attr }} | ||
| 256 | - steps: | ||
| 257 | - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| 258 | - with: | ||
| 259 | - persist-credentials: false | ||
| 260 | - sparse-checkout: .github/actions | ||
| 261 | - sparse-checkout-cone-mode: false | ||
| 262 | - | ||
| 263 | - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| 264 | - if: ${{ needs.build-aarch64-linux-v8.outputs.local-cache }} | ||
| 265 | - with: | ||
| 266 | - name: libv8-aarch64-linux.nar | ||
| 267 | - | ||
| 268 | - - uses: ./.github/actions/build-shared | ||
| 269 | - name: Build and test Node.js | ||
| 270 | - with: | ||
| 271 | - cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| 272 | - # Override just the `openssl` attr of the default shared-lib set with | ||
| 273 | - # the matrix-selected nixpkgs attribute (e.g. `openssl_3_6`). All | ||
| 274 | - # other shared libs (brotli, cares, libuv, …) keep their defaults. | ||
| 275 | - # `permittedInsecurePackages` whitelists just the matrix-selected | ||
| 276 | - # release (e.g. `openssl-1.1.1w`) so EOL-with-extended-support | ||
| 277 | - # cycles evaluate without relaxing nixpkgs' meta check globally. | ||
| 278 | - extra-nix-flags: | | ||
| 279 | - --arg useSeparateDerivationForV8 ${{ needs.build-aarch64-linux-v8.outputs.local-cache && '"$(nix-store --import < libv8-aarch64-linux.nar)"' || 'true' }} \ | ||
| 280 | - --arg sharedLibDeps "(import $TAR_DIR/tools/nix/sharedLibDeps.nix {}) // { | ||
| 281 | - openssl = (import $TAR_DIR/tools/nix/openssl-matrix.nix {}).$OPENSSL_ATTR; | ||
| 282 | - }" \ | ||
| 244 | + uses: ./.github/workflows/build-shared.yml | ||
| 245 | + with: | ||
| 246 | + runner: ubuntu-24.04-arm | ||
| 247 | + v8-nar: ${{ needs.build-aarch64-linux-v8.outputs.local-cache && 'libv8-aarch64-linux.nar' }} | ||
| 248 | + # Override just the `openssl` attr of the default shared-lib set with | ||
| 249 | + # the matrix-selected nixpkgs attribute (e.g. `openssl_3_6`). All | ||
| 250 | + # other shared libs (brotli, cares, libuv, …) keep their defaults. | ||
| 251 | + # `permittedInsecurePackages` whitelists just the matrix-selected | ||
| 252 | + # release (e.g. `openssl-1.1.1w`) so EOL-with-extended-support | ||
| 253 | + # cycles evaluate without relaxing nixpkgs' meta check globally. | ||
| 254 | + extra-nix-flags: | | ||
| 255 | + --arg useSeparateDerivationForV8 ${{ needs.build-aarch64-linux-v8.outputs.local-cache && '"$(nix-store --import < libv8-aarch64-linux.nar)"' || 'true' }} \ | ||
| 256 | + --arg sharedLibDeps "(import $TAR_DIR/tools/nix/sharedLibDeps.nix {}) // { | ||
| 257 | + openssl = builtins.getAttr \"${{ | ||
| 258 | + !contains(matrix.openssl.attr, '$') && !contains(matrix.openssl.attr, '\"') && !contains(matrix.openssl.attr, '\') && !contains(matrix.openssl.attr, '`') && matrix.openssl.attr | ||
| 259 | + }}\" (import $TAR_DIR/tools/nix/openssl-matrix.nix {}); | ||
| 260 | + }" \ | ||
| 261 | + secrets: | ||
| 262 | + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments