| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a95830b commit 2af4c89
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -173,6 +173,8 @@ jobs: | |||
| 173 | 173 | outputs: | |
| 174 | 174 | local-cache: ${{ steps.upload.outcome != 'skipped' && 'true' || '' }} | |
| 175 | 175 | matrix: ${{ steps.query.outputs.matrix }} | |
| 176 | + env: | ||
| 177 | + HAS_CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN && 'true' }} | ||
| 176 | 178 | steps: | |
| 177 | 179 | - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| 178 | 180 | with: | |
@@ -189,58 +191,49 @@ jobs: | |||
| 189 | 191 | with: | |
| 190 | 192 | extra_nix_config: sandbox = true | |
| 191 | 193 | ||
| 192 | - - name: Evaluate V8 derivation | ||
| 194 | + - name: Evaluate V8 derivation, check its cache status | ||
| 193 | 195 | id: v8-drv | |
| 194 | 196 | run: | | |
| 195 | 197 | V8_DRV=$( | |
| 196 | 198 | nix-instantiate -E "builtins.filter (p: p.pname == ''v8'') (import $TAR_DIR/shell.nix { useSeparateDerivationForV8=true; }).buildInputs" | |
| 197 | 199 | ) | |
| 200 | + V8_STORE_PATH=$(nix-store -q --outputs "$V8_DRV") | ||
| 198 | 201 | echo "V8_DRV=$V8_DRV" >> "$GITHUB_OUTPUT" | |
| 199 | - echo "STORE_PATH=$(nix-store -q --outputs "$V8_DRV")" >> "$GITHUB_OUTPUT" | ||
| 200 | - | ||
| 201 | - - name: Check if available on Cachix | ||
| 202 | - id: cachix-check | ||
| 203 | - run: | | ||
| 204 | - echo 'HAS_WRITE_TOKEN=${{ secrets.CACHIX_AUTH_TOKEN && 'true' }}' >> "$GITHUB_OUTPUT" | ||
| 205 | 202 | set -x | |
| 206 | 203 | [ "$(curl -ISsw "%{http_code}" -o /dev/null "https://nodejs.cachix.org/$(basename ${V8_STORE_PATH%-v8-*}).narinfo")" != "200" ] || | |
| 207 | 204 | echo "ALREADY_CACHED=true" >> "$GITHUB_OUTPUT" | |
| 208 | - env: | ||
| 209 | - V8_STORE_PATH: ${{ steps.v8-drv.outputs.STORE_PATH }} | ||
| 210 | 205 | ||
| 211 | 206 | - uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17 | |
| 212 | - if: ${{ steps.cachix-check.outputs.ALREADY_CACHED != 'true' }} | ||
| 207 | + if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' }} | ||
| 213 | 208 | with: | |
| 214 | 209 | name: nodejs | |
| 215 | 210 | authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| 216 | 211 | ||
| 217 | - - name: Build V8 derivation | ||
| 218 | - if: ${{ steps.cachix-check.outputs.ALREADY_CACHED != 'true' }} | ||
| 219 | - run: nix-store --export "$(nix-build "$V8_DRV")" > libv8 | ||
| 212 | + - name: Build V8 to cache it | ||
| 213 | + if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' }} | ||
| 214 | + run: nix-store --export "$(nix-build "$V8_DRV")" > libv8-aarch64-linux.nar | ||
| 220 | 215 | env: | |
| 221 | 216 | V8_DRV: ${{ steps.v8-drv.outputs.V8_DRV }} | |
| 222 | 217 | ||
| 223 | - - name: Upload libv8 | ||
| 224 | - if: ${{ steps.cachix-check.outputs.ALREADY_CACHED != 'true' && steps.cachix-check.outputs.HAS_WRITE_TOKEN != 'true' }} | ||
| 218 | + - name: Upload libv8-aarch64-linux.nar | ||
| 219 | + if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' && env.HAS_CACHIX_AUTH_TOKEN != 'true' }} | ||
| 225 | 220 | id: upload | |
| 226 | 221 | uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| 227 | 222 | with: | |
| 228 | - name: libv8 | ||
| 229 | - path: libv8 | ||
| 223 | + name: libv8-aarch64-linux.nar | ||
| 224 | + path: libv8-aarch64-linux.nar | ||
| 230 | 225 | ||
| 231 | 226 | - name: Collect matrix of support OpenSSL versions | |
| 232 | 227 | id: query | |
| 233 | 228 | run: | | |
| 234 | - { | ||
| 235 | - echo 'matrix<<EOF' | ||
| 229 | + echo "matrix=$( | ||
| 236 | 230 | nix-instantiate --eval --strict --json -E " | |
| 237 | 231 | let | |
| 238 | 232 | matrix = import $TAR_DIR/tools/nix/openssl-matrix.nix {}; | |
| 239 | 233 | in | |
| 240 | 234 | builtins.map (attr: { inherit attr; inherit (builtins.getAttr attr matrix) name; }) (builtins.attrNames matrix) | |
| 241 | 235 | " | |
| 242 | - echo 'EOF' | ||
| 243 | - } >> "$GITHUB_OUTPUT" | ||
| 236 | + )" >> "$GITHUB_OUTPUT" | ||
| 244 | 237 | ||
| 245 | 238 | # Builds and tests Node.js with shared libraries against every supported | |
| 246 | 239 | # OpenSSL release version available in the repo-pinned nixpkgs. The default | |
@@ -268,7 +261,7 @@ jobs: | |||
| 268 | 261 | - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| 269 | 262 | if: ${{ needs.build-aarch64-linux-v8.outputs.local-cache }} | |
| 270 | 263 | with: | |
| 271 | - name: libv8 | ||
| 264 | + name: libv8-aarch64-linux.nar | ||
| 272 | 265 | ||
| 273 | 266 | - uses: ./.github/actions/build-shared | |
| 274 | 267 | name: Build and test Node.js | |
@@ -281,7 +274,7 @@ jobs: | |||
| 281 | 274 | # release (e.g. `openssl-1.1.1w`) so EOL-with-extended-support | |
| 282 | 275 | # cycles evaluate without relaxing nixpkgs' meta check globally. | |
| 283 | 276 | extra-nix-flags: | | |
| 284 | - --arg useSeparateDerivationForV8 ${{ needs.build-aarch64-linux-v8.outputs.local-cache && '"$(nix-store --import < libv8)"' || 'true' }} \ | ||
| 277 | + --arg useSeparateDerivationForV8 ${{ needs.build-aarch64-linux-v8.outputs.local-cache && '"$(nix-store --import < libv8-aarch64-linux.nar)"' || 'true' }} \ | ||
| 285 | 278 | --arg sharedLibDeps "(import $TAR_DIR/tools/nix/sharedLibDeps.nix {}) // { | |
| 286 | 279 | openssl = (import $TAR_DIR/tools/nix/openssl-matrix.nix {}).$OPENSSL_ATTR; | |
| 287 | 280 | }" \ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments