diff --git a/.github/actions/install-clang/action.yml b/.github/actions/install-clang/action.yml deleted file mode 100644 index 765ad07ef3cd..000000000000 --- a/.github/actions/install-clang/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Install Clang -description: Installs a specific Clang version. Useful if the GitHub runner does not have it by default. -inputs: - clang-version: - description: The Clang major version to install - required: true - -runs: - using: composite - steps: - - name: Install Clang - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y clang-${{ inputs.clang-version }} diff --git a/.github/actions/undici-wpt-current/action.yml b/.github/actions/undici-wpt-current/action.yml deleted file mode 100644 index ffedcaa0fadc..000000000000 --- a/.github/actions/undici-wpt-current/action.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Run undici WPT (current) -description: Runs undici WPT tests for undici >= 7 and merges results into the Node.js WPT report - -inputs: - undici-version: - required: true - description: undici version tag to checkout - wpt-report: - required: true - description: Path to the Node.js WPT report to merge into - -runs: - using: composite - steps: - - name: Checkout undici - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: nodejs/undici - persist-credentials: false - path: undici - clean: false - ref: ${{ inputs.undici-version }} - - name: Prepare WPT checkout - shell: bash - run: | - rm -rf undici/test/web-platform-tests/wpt - mv test/fixtures/wpt undici/test/web-platform-tests/wpt - - name: Configure hosts - shell: bash - working-directory: undici/test/web-platform-tests/wpt - run: python3 wpt make-hosts-file | sudo tee -a /etc/hosts - - name: Install dependencies - shell: bash - working-directory: undici - run: npm install - - name: Run WPT - shell: bash - working-directory: undici - env: - CI: 'true' - WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json - run: npm run test:wpt || true - - name: Merge report - shell: bash - env: - NODE_WPT_REPORT: ${{ inputs.wpt-report }} - UNDICI_WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json - run: | - if [ -f "$UNDICI_WPT_REPORT" ]; then - jq -sc ' - .[0].results += .[1].results | - .[0].time_end = .[1].time_end | - .[0] - ' "$NODE_WPT_REPORT" "$UNDICI_WPT_REPORT" > "${NODE_WPT_REPORT}.tmp" - mv "${NODE_WPT_REPORT}.tmp" "$NODE_WPT_REPORT" - fi diff --git a/.github/actions/undici-wpt-legacy/action.yml b/.github/actions/undici-wpt-legacy/action.yml deleted file mode 100644 index 77a8b3fee469..000000000000 --- a/.github/actions/undici-wpt-legacy/action.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Run undici WPT (legacy) -description: Runs undici WPT tests for undici < 7 and appends results to the Node.js WPT report - -inputs: - undici-version: - required: true - description: undici version tag to checkout - wpt-report: - required: true - description: Path to the Node.js WPT report - -runs: - using: composite - steps: - - name: Checkout undici - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: nodejs/undici - persist-credentials: false - path: undici - clean: false - ref: ${{ inputs.undici-version }} - - name: Prepare WPT checkout - shell: bash - run: | - rm -rf undici/test/wpt/tests - mv test/fixtures/wpt undici/test/wpt/tests - - name: Install dependencies - shell: bash - working-directory: undici - run: npm install - - name: Run WPT - shell: bash - working-directory: undici - env: - WPT_REPORT: ${{ inputs.wpt-report }} - run: npm run test:wpt || true diff --git a/.github/codeql-config.yml b/.github/codeql-config.yml deleted file mode 100644 index d042ed960969..000000000000 --- a/.github/codeql-config.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: CodeQL config - -paths-ignore: - - test - - deps - - benchmark diff --git a/.github/workflows/author-ready-conflicts.yml b/.github/workflows/author-ready-conflicts.yml deleted file mode 100644 index f447c6b80a2e..000000000000 --- a/.github/workflows/author-ready-conflicts.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Unlabel not-ready pull requests - -on: - schedule: - - cron: 15 3 * * * - -permissions: - contents: read - -jobs: - remove-label: - name: Remove author ready - if: github.repository == 'nodejs/node' - runs-on: ubuntu-slim - permissions: - pull-requests: write - steps: - - name: Remove the label and comment - env: - GH_TOKEN: ${{ github.token }} - MESSAGE: >- - This pull request has conflicts with its base branch, removing the - `author ready` label. - - Please - [rebase](https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#step-5-rebase) - your branch onto the latest base branch, resolve the conflicts - locally, and force-push. - - Afterwards the pull request needs a fresh collaborator approval, - and a collaborator will add the label back once it is - [author ready](https://github.com/nodejs/node/blob/HEAD/doc/contributing/collaborator-guide.md#author-ready-pull-requests) - again. - run: | - # Requesting the mergeable field makes GitHub compute the merge state, - # pull requests still reported as UNKNOWN are picked up by a later run. - gh pr list \ - --repo "$GITHUB_REPOSITORY" \ - --label 'author ready' \ - --state open \ - --limit 100 \ - --json number,mergeable \ - --jq '.[] | select(.mergeable == "CONFLICTING") | .number' | - while read -r number; do - gh pr edit "$number" --repo "$GITHUB_REPOSITORY" --remove-label 'author ready' - printf '%s\n' "$MESSAGE" | - gh pr comment "$number" --repo "$GITHUB_REPOSITORY" --body-file - - done diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 9f4ed58447df..000000000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,271 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - inputs: - repo: - type: string - description: GitHub repository to fetch from (default to the current repo) - pr_id: - type: number - required: true - description: The PR to test - commit: - required: true - type: string - description: The expect HEAD of the PR - category: - required: true - type: string - description: The category (or categories) of tests to run, for example buffers, cluster etc. Maps to a folders in node/benchmark - filter: - type: string - description: A substring to restrict the benchmarks to run in a category. e.g. `net-c2c` - runs: - type: number - default: 30 - description: How many times to repeat each benchmark - post-comment: - type: boolean - description: Post a comment linking to the run, with the aggregated result once known. - token: - type: string - description: A GitHub token to post comments cross repository (not recommended) - -permissions: - contents: read - -jobs: - post-comment: - if: inputs.post-comment - outputs: - body: ${{ steps.comment.outputs.COMMENT_BODY }} - url: ${{ steps.comment.outputs.COMMENT_URL }} - runs-on: ubuntu-slim - permissions: - pull-requests: write - steps: - - name: Mark token input as sensitive - if: inputs.token != '' - run: printf '::add-mask::%s\n' "$COMMENT_TOKEN" - env: - COMMENT_TOKEN: ${{ inputs.token }} - - name: Add link to the current run - id: comment - run: | - FILTER_IF_SET= - [ -z "$FILTER" ] || FILTER_IF_SET=" / $FILTER" - COMMENT_BODY="Benchmark GHA (${CATEGORIES}${FILTER_IF_SET}): ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo "COMMENT_BODY=$COMMENT_BODY" >> "$GITHUB_OUTPUT" - echo "COMMENT_URL=$(gh pr comment -R "${REPO:-$GITHUB_REPOSITORY}" "$PR_ID" --body "$COMMENT_BODY")" >> "$GITHUB_OUTPUT" - env: - CATEGORIES: ${{ inputs.category }} - FILTER: ${{ inputs.filter }} - GH_TOKEN: ${{ inputs.token || github.token }} - REPO: ${{ inputs.repo }} - PR_ID: ${{ inputs.pr_id }} - build: - strategy: - fail-fast: true - matrix: - include: - - runner: ubuntu-24.04 - system: x86_64-linux - perfetto: true - - runner: ubuntu-24.04-arm - system: aarch64-linux - - runner: macos-15-intel - system: x86_64-darwin - - runner: macos-latest - system: aarch64-darwin - name: '${{ matrix.system }}: with shared libraries${{ matrix.perfetto && '' and perfetto'' || '''' }}' - runs-on: ${{ matrix.runner }} - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ${{ inputs.repo || github.repository }} - ref: refs/pull/${{ inputs.pr_id }}/merge - persist-credentials: false - fetch-depth: 2 - - - name: Validate PR head and roll back to base commit - run: | - [ "$(git rev-parse HEAD^2)" = "$EXPECTED_SHA" ] - git reset HEAD^ --hard - env: - EXPECTED_SHA: ${{ inputs.commit }} - - - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 - with: - extra_nix_config: sandbox = true - - - uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17 - with: - # We do not pass any `authToken` to avoid polluting the cache with potentially untrusted code. - name: nodejs - - - name: Configure sccache - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - with: - script: | - core.exportVariable('SCCACHE_GHA_ENABLED', 'on'); - core.exportVariable('SCCACHE_GHA_RW_MODE', 'READ_ONLY'); - core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on'); - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - - name: Build Node.js on the base commit - run: | - nix-shell \ - -I nixpkgs=./tools/nix/pkgs.nix \ - --pure --keep TAR_DIR --keep FLAKY_TESTS \ - --keep SCCACHE_GHA_ENABLED --keep SCCACHE_GHA_RW_MODE \ - --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ - --arg withPerfetto ${{ matrix.perfetto || false }} \ - --arg ccache '(import {}).sccache' \ - --run ' - make build-ci -j4 V=1 && sccache --stop-server - ' tools/nix/ci-shell.nix - mv out/Release/node base_node - - - name: Checkout the merge commit - run: git reset FETCH_HEAD --hard - - - name: Re-build Node.js on the merge commit - # Keep the compiler command unchanged for incremental builds, but never cache PR build outputs. - run: | - nix-shell \ - -I nixpkgs=./tools/nix/pkgs.nix \ - --pure --keep SCCACHE_LOCAL_RW_MODE \ - --arg withPerfetto ${{ matrix.perfetto || false }} \ - --arg ccache '(import {}).sccache' \ - --run ' - make build-ci -j4 V=1 ${{ contains(format(' {0} ', inputs.category), ' napi ') && '&& make bench-addons-build' || '' }} - ' tools/nix/ci-shell.nix - env: - SCCACHE_LOCAL_RW_MODE: READ_ONLY - - - name: Run benchmark - run: | - nix-shell \ - -I nixpkgs=./tools/nix/pkgs.nix \ - --pure --keep CATEGORIES --keep FILTER --keep RUNS --keep LC_ALL --keep LANG \ - --arg loadJSBuiltinsDynamically false \ - --arg ccache 'null' \ - --arg icu 'null' \ - --arg sharedLibDeps '{}' \ - --arg devTools '[]' \ - --run ' - set -o pipefail - read -r -a categories <<< "$CATEGORIES" - ./base_node benchmark/compare.js \ - --filter "$FILTER" \ - --runs "$RUNS" \ - --old ./base_node --new ./node \ - -- "${categories[@]}" \ - | tee /dev/stderr \ - > ${{ matrix.system }}.csv - echo "> [!WARNING] " - echo "> Do not take GHA benchmark results as face value, always confirm them" - echo "> using a dedicated machine, e.g. Jenkins CI." - echo - echo "Benchmark results:" - echo - echo '"'"'```'"'"' - Rscript benchmark/compare.R < ${{ matrix.system }}.csv - echo '"'"'```'"'"' - echo - echo "> [!WARNING] " - echo "> Do not take GHA benchmark results as face value, always confirm them" - echo "> using a dedicated machine, e.g. Jenkins CI." - ' | tee /dev/stderr >> "$GITHUB_STEP_SUMMARY" - env: - CATEGORIES: ${{ inputs.category }} - FILTER: ${{ inputs.filter }} - RUNS: ${{ inputs.runs }} - - - name: Upload raw benchmark results - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: csv-${{ matrix.system }} - path: ${{ matrix.system }}.csv - - aggregate-results: - needs: [build, post-comment] - if: ${{ always() && needs.build.result == 'success' && needs.post-comment.result == (inputs.post-comment && 'success' || 'skipped') }} - name: Aggregate benchmark results - runs-on: ubuntu-slim - permissions: - contents: read - pull-requests: write - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - sparse-checkout: | - benchmark/*.R - tools/nix/*.nix - *.nix - sparse-checkout-cone-mode: false - - - name: Download benchmark raw results - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - pattern: csv-* - merge-multiple: true - path: raw-results - - - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 - with: - extra_nix_config: sandbox = true - - - name: Benchmark results - run: | - nix-shell \ - -I nixpkgs=./tools/nix/pkgs.nix \ - --pure \ - -E '(import {}).mkShellNoCC { buildInputs = import ./tools/nix/benchmarkTools.nix { withHttpBenchmarkDeps = false; }; }' \ - --run ' - export LC_ALL=C.UTF-8 - echo "> [!WARNING] " - echo "> Do not take GHA benchmark results as face value, always confirm them" - echo "> using a dedicated machine, e.g. Jenkins CI." - echo - echo "Benchmark results:" - echo - echo '"'"'```'"'"' - awk "FNR==1 && NR!=1{next;}{print}" raw-results/*.csv | Rscript benchmark/compare.R - echo '"'"'```'"'"' - echo - echo "> [!WARNING] " - echo "> Do not take GHA benchmark results as face value, always confirm them" - echo "> using a dedicated machine, e.g. Jenkins CI." - ' | tee /dev/stderr ${{ inputs.post-comment && 'body.txt' || '' }} >> "$GITHUB_STEP_SUMMARY" - - name: Mark token input as sensitive - if: inputs.token != '' - run: printf '::add-mask::%s\n' "$COMMENT_TOKEN" - env: - COMMENT_TOKEN: ${{ inputs.token }} - - name: Edit comment - if: inputs.post-comment - run: | - { - echo "$COMMENT_BODY" - echo - echo '
Results' - echo - cat body.txt - echo - echo '
' - } | jq -Rrcs '{ body: . }' | gh api \ - --method PATCH \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2026-03-10" \ - "/repos/${REPO:-$GITHUB_REPOSITORY}/issues/comments/${COMMENT_URL##*-}" \ - --input - - env: - GH_TOKEN: ${{ inputs.token || github.token }} - REPO: ${{ inputs.repo }} - COMMENT_BODY: ${{ needs.post-comment.outputs.body }} - COMMENT_URL: ${{ needs.post-comment.outputs.url }} - PR_ID: ${{ inputs.pr_id }} diff --git a/.github/workflows/build-shared.yml b/.github/workflows/build-shared.yml deleted file mode 100644 index 73f7ec6afbbf..000000000000 --- a/.github/workflows/build-shared.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Build Node.js (shared libraries) - -on: - workflow_call: - inputs: - runner: - description: The runner to use for the job. - required: true - type: string - extra-nix-flags: - description: Additional CLI arguments appended to the nix-shell invocation. - required: false - type: string - default: '' - with-sccache: - description: Whether to enable sccache - required: false - type: boolean - default: false - v8-nar: - description: An optional name for the NAR archive for V8 that needs to be downloaded - required: false - type: string - default: '' - pkcs11-store-test: - description: Whether to enable the PKCS#11-backed crypto STORE test - required: false - type: boolean - default: false - secrets: - CACHIX_AUTH_TOKEN: - description: Cachix auth token for nodejs.cachix.org. - required: false - -permissions: {} - -env: - FLAKY_TESTS: keep_retrying - -jobs: - build: - runs-on: ${{ inputs.runner }} - steps: - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: tarballs - pattern: '*.tar.gz' - merge-multiple: true - - - name: Extract tarball - shell: bash - run: | - tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP" - echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV" - - - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 - with: - extra_nix_config: sandbox = true - - - uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17 - with: - name: nodejs - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - if: inputs.v8-nar - with: - name: ${{ inputs.v8-nar }} - - - name: Configure sccache - if: inputs.with-sccache - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - with: - script: | - core.exportVariable('SCCACHE_GHA_ENABLED', 'on'); - core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on'); - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - core.exportVariable('NIX_SCCACHE', '(import {}).sccache'); - - - name: Build Node.js and run tests - shell: bash - run: | - nix-shell \ - -I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \ - --pure --keep TAR_DIR --keep FLAKY_TESTS \ - --keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ - --arg ccache "${NIX_SCCACHE:-null}" \ - --arg pkcs11 ${{ inputs.pkcs11-store-test }} \ - ${{ inputs.extra-nix-flags }} \ - --run ' - make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS" - ' "$TAR_DIR/tools/nix/ci-shell.nix" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index d8eca1f2b798..000000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Run CodeQL - -on: - schedule: - - cron: 0 0 * * * - -permissions: - contents: read - -jobs: - analyze: - if: github.repository == 'nodejs/node' - name: Analyze - runs-on: ubuntu-slim - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [cpp, javascript, python] - - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 - with: - languages: ${{ matrix.language }} - config-file: ./.github/codeql-config.yml - - - name: Autobuild - uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 - with: - category: /language:${{matrix.language}} diff --git a/.github/workflows/contributor-guidance.yml b/.github/workflows/contributor-guidance.yml deleted file mode 100644 index 4035ea932077..000000000000 --- a/.github/workflows/contributor-guidance.yml +++ /dev/null @@ -1,141 +0,0 @@ -# This action requires the following secrets to be set on the repository: -# GH_USER_TOKEN: GitHub user token, used because FIRST_TIMER and -# FIRST_TIME_CONTRIBUTOR associations are only returned for -# privileged API calls - -name: Contributor guidance - -on: - pull_request_target: - types: [opened] - -permissions: {} - -jobs: - contributor: - name: Resolve contributor status - # Avoid allocating a runner unless a welcome or scan is a plausible outcome. - if: >- - github.run_attempt == 1 && - github.repository == 'nodejs/node' && - github.event.pull_request.user.type != 'Bot' && - (github.event.pull_request.author_association == 'CONTRIBUTOR' || - github.event.pull_request.author_association == 'FIRST_TIMER' || - github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' || - github.event.pull_request.author_association == 'NONE') - runs-on: ubuntu-slim - outputs: - is_first_time: ${{ steps.resolve.outputs.is_first_time }} - # The event association may not expose private organization membership, - # so gate the guidance job on the privileged API result. - should_scan: ${{ steps.resolve.outputs.should_scan }} - steps: - - name: Check author association - id: resolve - env: - EVENT_ASSOCIATION: ${{ github.event.pull_request.author_association }} - GH_TOKEN: ${{ secrets.GH_USER_TOKEN }} - NUMBER: ${{ github.event.pull_request.number }} - run: | - api_association=$(gh api "/repos/$GITHUB_REPOSITORY/pulls/$NUMBER" \ - --jq '.author_association') - echo "API author association: $api_association" - echo "Event author association: $EVENT_ASSOCIATION" - - case "$api_association" in - FIRST_TIMER|FIRST_TIME_CONTRIBUTOR) - echo 'is_first_time=true' >> "$GITHUB_OUTPUT" - echo 'should_scan=true' >> "$GITHUB_OUTPUT" - ;; - CONTRIBUTOR|NONE) - echo 'is_first_time=false' >> "$GITHUB_OUTPUT" - echo 'should_scan=true' >> "$GITHUB_OUTPUT" - ;; - COLLABORATOR|MANNEQUIN|MEMBER|OWNER) - echo 'is_first_time=false' >> "$GITHUB_OUTPUT" - echo 'should_scan=false' >> "$GITHUB_OUTPUT" - ;; - *) - echo "Unexpected author association: $api_association" >&2 - exit 1 - ;; - esac - - guidance: - name: Apply contributor guidance - needs: contributor - if: needs.contributor.outputs.should_scan == 'true' - runs-on: ubuntu-slim - permissions: - contents: read - pull-requests: write - steps: - - name: Scan contributor activity - id: agentscan - # The welcome should still be posted if this advisory scan fails. - continue-on-error: true - uses: MatteoGabriele/agentscan-action@8112fb79b33fafb8506159df20129a34209ac410 # v2.5.0 - with: - github-token: ${{ github.token }} - mode: labels - scan-pull-requests: true - scan-issues: false - auto-close: false - honeypot: false - # The privileged association check skips trusted authors before this job, - # so `trusted-author-associations` would be redundant here. - # trusted-author-associations: collaborator,member,owner - - - name: Comment with contributor guidance - if: env.IS_FIRST_TIME == 'true' || env.ADD_CAUTION == 'true' - env: - ADD_CAUTION: >- - ${{ - steps.agentscan.outputs.classification == 'mixed' || - steps.agentscan.outputs.classification == 'automation' || - steps.agentscan.outputs['community-flagged'] == 'true' - }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - IS_FIRST_TIME: ${{ needs.contributor.outputs.is_first_time }} - NUMBER: ${{ github.event.pull_request.number }} - WELCOME_MESSAGE: >2- - Welcome to Node.js, and thank you for your first contribution! - - Before review, please take a moment to read: - - * the [guide for first-time contributors](https://github.com/nodejs/node/blob/HEAD/doc/contributing/first-contributions.md) - * the [contribution and automation policies](https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md) - * the [pull request guide](https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md) - * the [AI use policy](https://github.com/nodejs/node/blob/HEAD/doc/contributing/ai-guidelines.md) - * the [Code of Conduct](https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md) - - Please make sure every commit is - [signed off](https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#step-4-commit). - For a first pull request, GitHub Actions require collaborator - approval and Jenkins CI must be started by a collaborator or triager, - so an initial wait is normal. - CAUTION_MESSAGE: >- - > [!CAUTION] - - > AgentScan found account activity patterns that may be consistent with - automation. This is a heuristic, not proof that this pull request was - opened by an agent or violates policy. AI-assisted contributions are - permitted, but automated tooling must not open pull requests without - advance approval, and contributors must personally understand, test, - verify, and take responsibility for every submitted change. See the - [AgentScan analysis](https://agentscan.tools/user/${{ github.event.pull_request.user.login }}), - [AI use policy](https://github.com/nodejs/node/blob/HEAD/doc/contributing/ai-guidelines.md), - and - [automation policy](https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md#automation-and-bots) - for additional context. - run: | - if [[ "$IS_FIRST_TIME" == "true" && "$ADD_CAUTION" == "true" ]]; then - body="$WELCOME_MESSAGE"$'\n\n'"$CAUTION_MESSAGE" - elif [[ "$IS_FIRST_TIME" == "true" ]]; then - body="$WELCOME_MESSAGE" - else - body="$CAUTION_MESSAGE" - fi - - printf '%s\n' "$body" | - gh pr comment "$NUMBER" --repo "$GITHUB_REPOSITORY" --body-file - diff --git a/.github/workflows/nix-changes-comment.yml b/.github/workflows/nix-changes-comment.yml deleted file mode 100644 index db96ff4a09ca..000000000000 --- a/.github/workflows/nix-changes-comment.yml +++ /dev/null @@ -1,98 +0,0 @@ -# This action requires the following secrets to be set on the repository: -# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes -name: Comment on PR on Nix changes - -on: - workflow_run: - workflows: [Nix files edited] - types: [completed] - -permissions: {} - -jobs: - aggregate-results: - if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }} - name: Aggregate results - runs-on: ubuntu-slim - permissions: - pull-requests: write - steps: - - name: Download artefacts - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - run-id: ${{ github.event.workflow_run.id }} - # Using privileged token to be able to download file from a different workflow - github-token: ${{ secrets.GH_USER_TOKEN }} - - - name: Fetch PR data - id: pr-data - run: | - mv requisites-*/* . - ls - if grep -nvHE '^/nix/store/[0-9a-df-np-sv-z]{32}-[A-Za-z0-9?=._+-]+$' requisites-*.list; then - echo 'Unexpected line format in requisites list; refusing to process.' >&2 - exit 1 - fi - echo "NUMBER=$(grep -E '^[0-9]+$' pr_number.txt || true)" >> "$GITHUB_OUTPUT" - - - name: Aggregate results - if: ${{ steps.pr-data.outputs.NUMBER }} - run: | - set -x - > requisites-before.list - > requisites-after.list - TABLE=$( - echo '| Platform | Number of requisites | Proportion of new derivations |' - echo '| :-: | -: | -: |' - TOTAL_BEFORE=0 - TOTAL_AFTER=0 - TOTAL_CHANGED=0 - QUOTE='`' - for PLATFORM in x86_64-linux aarch64-linux x86_64-darwin aarch64-darwin; do - BEFORE=$(wc -l < "requisites-${PLATFORM}-before.list") - TOTAL_BEFORE=$(($TOTAL_BEFORE + $BEFORE)) - AFTER=$(wc -l < "requisites-${PLATFORM}-after.list") - TOTAL_AFTER=$(($TOTAL_AFTER + $AFTER)) - DIFF="_no changes_" - [ "$BEFORE" = "$AFTER" ] || DIFF="**$([ "$AFTER" < "$BEFORE" ] || echo '+')$(($AFTER - $BEFORE))**" - CHANGED=$(git diff --no-index "requisites-${PLATFORM}-before.list" "requisites-${PLATFORM}-after.list" | grep -c '^+[^+]') - TOTAL_CHANGED=$(($TOTAL_CHANGED + $CHANGED)) - PERCENT=100 - [ "$CHANGED" = "$AFTER" ] || { - PERMILLE=$((1000 * $CHANGED / $AFTER)) - PERCENT="$((PERMILLE / 10)).$((PERMILLE % 10))" - } - echo "| ${QUOTE}${PLATFORM}${QUOTE} | $BEFORE -> $AFTER => $DIFF | $CHANGED / $AFTER = $PERCENT% |" - awk '{ print $0 " ('"$PLATFORM"')" }' "requisites-${PLATFORM}-before.list" >> requisites-before.list - awk '{ print $0 " ('"$PLATFORM"')" }' "requisites-${PLATFORM}-after.list" >> requisites-after.list - done - - DIFF="_no changes_" - [ "$TOTAL_BEFORE" = "$TOTAL_AFTER" ] || DIFF="**$([ "$TOTAL_AFTER" < "$TOTAL_BEFORE" ] || echo '+')$(($TOTAL_AFTER - $TOTAL_BEFORE))**" - PERCENT=100 - [ "$TOTAL_CHANGED" = "$TOTAL_AFTER" ] || { - PERMILLE=$((1000 * $TOTAL_CHANGED / $TOTAL_AFTER)) - PERCENT="$((PERMILLE / 10)).$((PERMILLE % 10))" - } - echo "| **Total** | $TOTAL_BEFORE -> $TOTAL_AFTER => $DIFF | $TOTAL_CHANGED / $TOTAL_AFTER = $PERCENT% |" - ) - sort -k1.45 requisites-before.list > requisites-before.sort - sort -k1.45 requisites-after.list > requisites-after.sort - if git diff -U0 --no-color --no-index requisites-before.sort requisites-after.sort > requisites.diff; then - echo 'No changes detected.' - else - { - echo "$TABLE" - echo - echo '
Changelog' - echo - echo '```diff' - tail -n +5 requisites.diff - echo '```' - echo - echo '
' - } | gh pr comment -R "$GITHUB_REPOSITORY" "$PR_NUMBER" -F - - fi - env: - GH_TOKEN: ${{ github.token }} - PR_NUMBER: ${{ steps.pr-data.outputs.NUMBER }} diff --git a/.github/workflows/nix-changes.yml b/.github/workflows/nix-changes.yml deleted file mode 100644 index 7eee0e2e7f5f..000000000000 --- a/.github/workflows/nix-changes.yml +++ /dev/null @@ -1,131 +0,0 @@ -# This action uses the following secrets: -# CACHIX_AUTH_TOKEN: Write access to nodejs.cachix.org – without it, the cache is read-only. -name: Nix files edited - -on: - push: - branches: - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x - paths: - - '**.nix' - - tools/certdata.txt - - tools/nix/** - - .github/workflows/nix-changes.yml - pull_request: - paths: - - '**.nix' - - tools/certdata.txt - - tools/nix/** - - .github/workflows/nix-changes.yml - types: [opened, synchronize, reopened, ready_for_review] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - diff: - if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - include: - - runner: ubuntu-24.04 - system: x86_64-linux - - runner: ubuntu-24.04-arm - system: aarch64-linux - - runner: macos-15-intel - system: x86_64-darwin - - runner: macos-latest - system: aarch64-darwin - name: '${{ matrix.system }}: dependencies diff' - runs-on: ${{ matrix.runner }} - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 2 - persist-credentials: false - sparse-checkout: | - shell.nix - tools/nix/ - tools/certdata.txt - sparse-checkout-cone-mode: false - - - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 - with: - extra_nix_config: sandbox = true - - - uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17 - with: - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: nodejs - - - name: Compute requisites after change - run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list - - - name: Compute requisites before change - run: | - BASE_SHA="$(git rev-parse HEAD^)" - if [ -n "$PUSH_BEFORE_SHA" ] && [ "$PUSH_BEFORE_SHA" != "$BASE_SHA" ] \ - && [ "$PUSH_BEFORE_SHA" != "0000000000000000000000000000000000000000" ] \ - && git fetch --no-tags --depth=1 origin "$PUSH_BEFORE_SHA"; then - BASE_SHA="$PUSH_BEFORE_SHA" - fi - git reset "$BASE_SHA" --hard - ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list - env: - PUSH_BEFORE_SHA: ${{ github.event_name == 'push' && github.event.before || '' }} - - - name: Output diff - run: | - { - if diff_output="$(git diff -U0 --no-color --no-index requisites-${{ matrix.system }}-before.list requisites-${{ matrix.system }}-after.list)"; then - echo 'No changes detected.' - else - echo '```diff' - echo "$diff_output" | tail -n +5 - echo '```' - fi - } >> "$GITHUB_STEP_SUMMARY" - - - name: Store PR number - if: ${{ github.event.pull_request && matrix.system == 'x86_64-linux' }} - run: echo "${{ github.event.pull_request.number }}" > pr_number.txt - - - name: Upload requisites lists - if: ${{ github.event.pull_request }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: requisites-${{ matrix.system }} - path: | - pr_number.* - requisites-${{ matrix.system }}-before.list - requisites-${{ matrix.system }}-after.list - - lint-nix: - if: github.event.pull_request.draft == false - runs-on: ubuntu-slim - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - sparse-checkout: '*.nix' - sparse-checkout-cone-mode: false - - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 - - name: Lint Nix files - run: | - NIX_LINTER=$(nix-instantiate --eval --raw -E '(import ./shell.nix {}).NIX_LINTER') - # Attempt to get it from cache, and fallback to building `devTools.nix` otherwise. - nix-store --realise "${NIX_LINTER%/bin/*}" || nix-build -I nixpkgs=tools/nix/pkgs.nix ./tools/nix/devTools.nix --no-out-link - "$NIX_LINTER" --quiet --ci && EXIT_CODE="$?" || EXIT_CODE="$?" - if [ "$EXIT_CODE" != "0" ] - then - git --no-pager diff || true - exit "$EXIT_CODE" - fi diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index eb5921edb932..000000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Close stale -on: - workflow_dispatch: - schedule: - # Run every day at 1:00 AM UTC. - - cron: 0 1 * * * - -# yamllint disable rule:empty-lines -env: - CLOSE_MESSAGE: > - This {0} has been automatically closed after 30 days of inactivity - following its stale status (no activity for a total of 120 days). - - If this is still relevant, feel free to reopen it or leave a comment - with additional details so we can continue the discussion. - - WARN_MESSAGE: > - This {0} has been marked as stale due to 90 days of inactivity. - - It will be automatically closed in 30 days if no further activity occurs. - If this is still relevant, please leave a comment or update it to keep it open. -# yamllint enable - -permissions: - contents: read - -jobs: - stale: - permissions: - issues: write # for actions/stale to close stale issues - pull-requests: write # for actions/stale to close stale PRs - actions: write # for actions/stale to cache stale saved state - if: github.repository == 'nodejs/node' - runs-on: ubuntu-slim - steps: - - uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 90 - days-before-close: 30 - stale-issue-label: stale - exempt-issue-labels: never-stale, confirmed-bug - close-issue-message: ${{ format(env.CLOSE_MESSAGE, 'issue') }} - stale-issue-message: ${{ format(env.WARN_MESSAGE, 'issue') }} - stale-pr-label: stale - exempt-pr-labels: never-stale - close-pr-message: ${{ format(env.CLOSE_MESSAGE, 'pull request') }} - stale-pr-message: ${{ format(env.WARN_MESSAGE, 'pull request') }} - # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits - operations-per-run: 2500 - remove-stale-when-updated: true diff --git a/.github/workflows/stress-test.yml b/.github/workflows/stress-test.yml deleted file mode 100644 index e47c114d2f3f..000000000000 --- a/.github/workflows/stress-test.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Stress Test (rebase tested branch on main for cache reuse) - -on: - workflow_dispatch: - inputs: - test_path: - description: Test path or glob (e.g. test/parallel/test-debugger-break.js or "test/parallel/test-debugger-*") - required: true - type: string - os: - description: Runner to use - required: true - default: macos-15 - type: choice - options: - - macos-15 - - ubuntu-24.04 - - ubuntu-24.04-arm - repeat: - description: Number of times to repeat each test (--repeat) - required: true - default: '1000' - type: string - test_jobs: - description: Number of jobs to run in parallel (-j). - required: true - default: '1' - type: string - test_args: - description: Extra args for tools/test.py, space-separated (e.g. "-t 10 --worker") - required: false - default: '' - type: string - -env: - PYTHON_VERSION: '3.15' - XCODE_VERSION: '16.4' - CLANG_VERSION: '19' - RUSTC_VERSION: '1.86' - -permissions: - contents: read - -jobs: - stress-test: - runs-on: ${{ inputs.os }} - env: - # Linux builds with clang (matching test-linux.yml), macOS with gcc/g++. - CC: ${{ startsWith(inputs.os, 'ubuntu') && 'sccache clang-19' || 'sccache gcc' }} - CXX: ${{ startsWith(inputs.os, 'ubuntu') && 'sccache clang++-19' || 'sccache g++' }} - # Enable sccache - this is okay for a manually-dispatched workflow that is typically used to - # test lib-only or test-only deflaking changes. This should be able to pick up cache from - # test-linux.yml and test-macos.yml running on the main branch. - SCCACHE_GHA_ENABLED: 'true' - SCCACHE_IDLE_TIMEOUT: '0' - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - path: node - - name: Install Clang ${{ env.CLANG_VERSION }} - if: runner.os == 'Linux' - uses: $/.github/actions/install-clang - with: - clang-version: ${{ env.CLANG_VERSION }} - - name: Set up Xcode ${{ env.XCODE_VERSION }} - if: runner.os == 'macOS' - run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - allow-prereleases: true - - name: Install Rust ${{ env.RUSTC_VERSION }} - run: | - rustup override set "$RUSTC_VERSION" - rustup --version - - name: Set up sccache - uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - with: - version: v0.17.0 - # This is needed due to https://github.com/nodejs/build/issues/3878 - - name: Cleanup - if: runner.os == 'macOS' - run: | - echo "::group::Free space before cleanup" - df -h - echo "::endgroup::" - echo "::group::Cleaned Files" - - sudo rm -rf /Users/runner/Library/Android/sdk - - echo "::endgroup::" - echo "::group::Free space after cleanup" - df -h - echo "::endgroup::" - - name: Build - run: make -C node build-ci -j"$(getconf _NPROCESSORS_ONLN)" V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support" - - name: Stress run ${{ inputs.test_path }} x${{ inputs.repeat }} - shell: bash - env: - REPEAT: ${{ inputs.repeat }} - JOBS: ${{ inputs.test_jobs }} - TEST_ARGS: ${{ inputs.test_args }} - TEST_PATH: ${{ inputs.test_path }} - run: | - cd node - read -ra EXTRA_ARGS <<< "$TEST_ARGS" - python3 tools/test.py \ - --repeat "$REPEAT" \ - -j "$JOBS" \ - -p actions \ - "${EXTRA_ARGS[@]}" \ - "$TEST_PATH" diff --git a/.github/workflows/test-linux-perfetto.yml b/.github/workflows/test-linux-perfetto.yml deleted file mode 100644 index befb17007059..000000000000 --- a/.github/workflows/test-linux-perfetto.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Test Linux (with Perfetto) - -on: - workflow_dispatch: - pull_request: - # Only targeting paths specific to the vendored version of Perfetto, `test-shared` - # is taking care of rest of the coverage. - paths: - - .github/workflows/test-linux-perfetto.yml - - common.gypi - - configure.py - - deps/perfetto/** - - node.gyp - - node.gypi - - tools/v8_gypfiles/v8.gyp - types: [opened, synchronize, reopened, ready_for_review] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - PYTHON_VERSION: '3.15' - FLAKY_TESTS: keep_retrying - CLANG_VERSION: '19' - CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang-19 - CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++-19 - SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} - SCCACHE_IDLE_TIMEOUT: '0' - RUSTC_VERSION: '1.86' - -permissions: - contents: read - -jobs: - test-perfetto: - if: github.event.pull_request.draft == false - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - path: node - - name: Install Clang ${{ env.CLANG_VERSION }} - uses: $/.github/actions/install-clang - with: - clang-version: ${{ env.CLANG_VERSION }} - - name: Install Rust ${{ env.RUSTC_VERSION }} - run: | - rustup override set "$RUSTC_VERSION" - rustup --version - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - allow-prereleases: true - - name: Set up sccache - if: github.base_ref == 'main' || github.ref_name == 'main' - uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - with: - version: v0.17.0 - - name: Build - working-directory: node - run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support --with-perfetto" - - name: Get trace_processor - working-directory: node - run: make tools/perfetto/trace_processor_shell - - name: Test - working-directory: node - run: make test-ci -j1 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" - - name: Ensure running tests did not cause any change in the tree - working-directory: node - run: git add -A && git diff --name-only --exit-code --staged diff --git a/.github/workflows/test-linux-quic.yml b/.github/workflows/test-linux-quic.yml deleted file mode 100644 index f9ccef859783..000000000000 --- a/.github/workflows/test-linux-quic.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Test Linux (with QUIC) - -on: - workflow_dispatch: - pull_request: - paths: - - .github/workflows/test-linux-quic.yml - - configure.py - - node.gyp - - node.gypi - - deps/v8/** - - deps/ngtcp2/** - - deps/nghttp3/** - - deps/openssl/** - - src/quic/** - - src/node_bob* - - lib/quic.js - - lib/http3.js - - lib/internal/quic/** - - lib/stream/iter.js - - lib/internal/streams/iter/** - - test/cctest/test_quic_* - - test/common/quic* - - test/common/quic/** - - test/parallel/*quic* - - test/parallel/test-stream-iter-* - types: [opened, synchronize, reopened, ready_for_review] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - PYTHON_VERSION: '3.15' - FLAKY_TESTS: keep_retrying - CLANG_VERSION: '19' - CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang-19 - CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++-19 - SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} - SCCACHE_IDLE_TIMEOUT: '0' - RUSTC_VERSION: '1.86' - -permissions: - contents: read - -jobs: - test-quic: - if: github.event.pull_request.draft == false - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - path: node - - name: Install Clang ${{ env.CLANG_VERSION }} - uses: $/.github/actions/install-clang - with: - clang-version: ${{ env.CLANG_VERSION }} - - name: Install Rust ${{ env.RUSTC_VERSION }} - run: | - rustup override set "$RUSTC_VERSION" - rustup --version - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - allow-prereleases: true - - name: Set up sccache - if: github.base_ref == 'main' || github.ref_name == 'main' - uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - with: - version: v0.17.0 - - name: Build - working-directory: node - run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support --experimental-quic" - - name: Test - working-directory: node - run: make test-ci -j1 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" - - name: Ensure running tests did not cause any change in the tree - working-directory: node - run: git add -A && git diff --name-only --exit-code --staged diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml deleted file mode 100644 index 8292ac253fd2..000000000000 --- a/.github/workflows/test-shared.yml +++ /dev/null @@ -1,273 +0,0 @@ -# This action uses the following secrets: -# CACHIX_AUTH_TOKEN: Write access to nodejs.cachix.org – without it, the cache is read-only. -name: Test Shared libraries - -on: - pull_request: - paths-ignore: - - '**.md' - - eslint.config.mjs - - '**/eslint.config_partial.mjs' - - android-configure - - android-configure.py - - android-patches/** - - benchmarks/** - - codecov.yml - - deps/LIEF/** - - deps/ada/** - - deps/brotli/** - - deps/cares/** - - deps/corepack/** - - deps/crates/** - - deps/googletest/** - - deps/histogram/** - - deps/icu-small/** - - deps/icu-tmp/** - - deps/libffi/** - - deps/llhttp/** - - deps/merve/** - - deps/nbytes/** - - deps/nghttp2/** - - deps/ngtcp2/** - - deps/openssl/*/** - - deps/perfetto/** - - deps/simdjson/** - - deps/sqlite/** - - deps/uv/** - - deps/uvwasi/** - - deps/v8/third_party/abseil-cpp/** - - deps/v8/third_party/highway/** - - deps/v8/third_party/simdutf/** - - deps/zlib/** - - deps/zstd/** - - doc/** - - pyproject.yml - - tsconfig.json - - test/internet/** - - tools/** - - '!tools/gyp/**' - - '!tools/nix/**' - - '!tools/v8/**' - - '!tools/v8_gypfiles/**' - - tools/nix/list-requisites.sh - - typings/** - - vcbuild.bat - - .** - - '!.github/workflows/test-shared.yml' - - '!.github/workflows/build-shared.yml' - types: [opened, synchronize, reopened, ready_for_review] - push: - branches: - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x - paths-ignore: - - '**.md' - - eslint.config.mjs - - '**/eslint.config_partial.mjs' - - android-configure - - android-configure.py - - android-patches/** - - benchmarks/** - - codecov.yml - - deps/LIEF/** - - deps/ada/** - - deps/brotli/** - - deps/cares/** - - deps/corepack/** - - deps/crates/** - - deps/googletest/** - - deps/histogram/** - - deps/icu-small/** - - deps/icu-tmp/** - - deps/libffi/** - - deps/llhttp/** - - deps/merve/** - - deps/nbytes/** - - deps/nghttp2/** - - deps/ngtcp2/** - - deps/openssl/*/** - - deps/perfetto/** - - deps/simdjson/** - - deps/sqlite/** - - deps/uv/** - - deps/uvwasi/** - - deps/v8/third_party/abseil-cpp/** - - deps/v8/third_party/highway/** - - deps/v8/third_party/simdutf/** - - deps/zlib/** - - deps/zstd/** - - doc/** - - pyproject.yml - - tsconfig.json - - test/internet/** - - tools/** - - '!tools/gyp/**' - - '!tools/nix/**' - - '!tools/v8/**' - - '!tools/v8_gypfiles/**' - - tools/nix/list-requisites.sh - - typings/** - - vcbuild.bat - - .** - - '!.github/workflows/test-shared.yml' - - '!.github/workflows/build-shared.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - build-tarball: - if: github.event.pull_request.draft == false - name: ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }} - runs-on: ubuntu-slim - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Make tarball - run: | - export DATESTRING=$(date "+%Y-%m-%d") - export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA") - ./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1 GZIP_COMPRESSION=6 - env: - DISTTYPE: nightly - - - name: Upload tarball artifact - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - path: '*.tar.gz' - archive: false - - build: - needs: build-tarball - strategy: - fail-fast: false - matrix: - include: - - runner: ubuntu-24.04 - system: x86_64-linux - # Exercise the trace-event code against a perfetto-enabled V8. - perfetto: true - # built separately in build-aarch64-linux-v8 - # - runner: ubuntu-24.04-arm - # system: aarch64-linux - - runner: macos-15-intel - system: x86_64-darwin - - runner: macos-latest - system: aarch64-darwin - name: '${{ matrix.system }}: with shared libraries${{ matrix.perfetto && '' and perfetto'' || '''' }}' - uses: $/.github/workflows/build-shared.yml - with: - runner: ${{ matrix.runner }} - with-sccache: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} - extra-nix-flags: ${{ matrix.perfetto && '--arg withPerfetto true' || '' }} - secrets: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - - build-aarch64-linux-v8: - needs: build-tarball - runs-on: ubuntu-24.04-arm - name: 'aarch64-linux: Cache V8 build' - outputs: - local-cache: ${{ steps.upload.outcome != 'skipped' && 'true' || '' }} - matrix: ${{ steps.query.outputs.matrix }} - env: - HAS_CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN && 'true' }} - steps: - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: tarballs - - - name: Extract tarball - shell: bash - run: | - tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP" - echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV" - - - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 - with: - extra_nix_config: sandbox = true - - - name: Evaluate V8 derivation, check its cache status - id: v8-drv - run: | - V8_DRV=$( - nix-instantiate -E "builtins.filter (p: p.pname == ''v8'') (import $TAR_DIR/tools/nix/ci-shell.nix {}).buildInputs" - ) - V8_STORE_PATH=$(nix-store -q --outputs "$V8_DRV") - echo "V8_DRV=$V8_DRV" >> "$GITHUB_OUTPUT" - set -x - [ "$(curl -ISsw "%{http_code}" -o /dev/null "https://nodejs.cachix.org/$(basename ${V8_STORE_PATH%-v8-*}).narinfo")" != "200" ] || - echo "ALREADY_CACHED=true" >> "$GITHUB_OUTPUT" - - - uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17 - if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' }} - with: - name: nodejs - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - name: Build V8 to cache it - if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' }} - run: nix-store --export "$(nix-build "$V8_DRV")" > libv8-aarch64-linux.nar - env: - V8_DRV: ${{ steps.v8-drv.outputs.V8_DRV }} - - - name: Upload libv8-aarch64-linux.nar - if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' && env.HAS_CACHIX_AUTH_TOKEN != 'true' }} - id: upload - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libv8-aarch64-linux.nar - path: libv8-aarch64-linux.nar - - - name: Collect matrix of support OpenSSL versions - id: query - run: | - echo "matrix=$( - nix-instantiate --eval --strict --json -E " - let - matrix = import $TAR_DIR/tools/nix/openssl-matrix.nix {}; - in - builtins.map (attr: { inherit attr; inherit (builtins.getAttr attr matrix) name; }) (builtins.attrNames matrix) - " - )" >> "$GITHUB_OUTPUT" - - # Builds and tests Node.js with shared libraries against every supported - # OpenSSL release version available in the repo-pinned nixpkgs. The default - # shared `openssl` from tools/nix/sharedLibDeps.nix is overridden per matrix - # entry, while all other shared libs remain at their defaults. Only runs on - # a single runner/system (aarch64-linux) to keep the matrix to a minimum. - build-openssl: - needs: build-aarch64-linux-v8 - strategy: - fail-fast: false - matrix: - openssl: ${{ fromJSON(needs.build-aarch64-linux-v8.outputs.matrix) }} - name: 'aarch64-linux: with shared ${{ matrix.openssl.name }}' - uses: $/.github/workflows/build-shared.yml - with: - runner: ubuntu-24.04-arm - v8-nar: ${{ needs.build-aarch64-linux-v8.outputs.local-cache && 'libv8-aarch64-linux.nar' }} - pkcs11-store-test: ${{ matrix.openssl.attr == 'openssl' }} - # Override just the `openssl` attr of the default shared-lib set with - # the matrix-selected nixpkgs attribute (e.g. `openssl_3_6`). All - # other shared libs (brotli, cares, libuv, …) keep their defaults. - # `permittedInsecurePackages` whitelists just the matrix-selected - # release (e.g. `openssl-1.1.1w`) so EOL-with-extended-support - # cycles evaluate without relaxing nixpkgs' meta check globally. - extra-nix-flags: | - --arg useSeparateDerivationForV8 ${{ needs.build-aarch64-linux-v8.outputs.local-cache && '"$(nix-store --import < libv8-aarch64-linux.nar)"' || 'true' }} \ - --arg sharedLibDeps "(import $TAR_DIR/tools/nix/sharedLibDeps.nix {}) // { - openssl = builtins.getAttr \"${{ - !contains(matrix.openssl.attr, '$') && !contains(matrix.openssl.attr, '\"') && !contains(matrix.openssl.attr, '\') && !contains(matrix.openssl.attr, '`') && matrix.openssl.attr - }}\" (import $TAR_DIR/tools/nix/openssl-matrix.nix {}); - }" \ - secrets: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}