From fb8cee70b960067ad2e3f831285df6f8f91066fe Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 21:56:55 +0200 Subject: [PATCH 01/14] test actions/checkout --- .github/workflows/commit-lint.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 6673f2942da..3a2f4c14eb9 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -11,6 +11,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} # Last 100 commits should be enough for a PR fetch-depth: 100 + - run: git log --oneline - name: Use Node.js 12 uses: actions/setup-node@v1 with: @@ -19,3 +20,11 @@ jobs: run: | echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" git log --oneline ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep -v -e fixup -e squash | awk '{ print $1 }' | xargs npx -q core-validate-commit --no-validate-metadata --tap + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + # Last 100 commits should be enough for a PR + fetch-depth: 100 + - run: git log --oneline \ No newline at end of file From fa0fafb6ca4829fd84f6134ab8c3e5be1b6f30f2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 22:02:20 +0200 Subject: [PATCH 02/14] test: valid commit msg From b6aa2a75a3d8eaa7066466fddf654e740fd3bb89 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 22:06:06 +0200 Subject: [PATCH 03/14] POC --- .github/workflows/auto-start-ci.yml | 64 ---------- .github/workflows/build-tarball.yml | 74 ----------- .github/workflows/build-windows.yml | 32 ----- .github/workflows/close-stalled.yml | 26 ---- .github/workflows/comment-labeled.yml | 29 ----- .../commit-lint-problem-matcher.json | 13 -- .github/workflows/commit-lint.yml | 12 +- .github/workflows/commit-queue.yml | 82 ------------ .github/workflows/coverage-linux.yml | 54 -------- .github/workflows/coverage-windows.yml | 55 -------- .github/workflows/daily.yml | 28 ----- .github/workflows/label-pr.yml | 14 --- .github/workflows/license-builder.yml | 23 ---- .github/workflows/linters.yml | 117 ------------------ .github/workflows/misc.yml | 34 ----- .github/workflows/notify-force-push.yml | 26 ---- .../remark-lint-problem-matcher.json | 22 ---- .github/workflows/test-asan.yml | 41 ------ .github/workflows/test-linux.yml | 32 ----- .github/workflows/test-macos.yml | 36 ------ 20 files changed, 2 insertions(+), 812 deletions(-) delete mode 100644 .github/workflows/auto-start-ci.yml delete mode 100644 .github/workflows/build-tarball.yml delete mode 100644 .github/workflows/build-windows.yml delete mode 100644 .github/workflows/close-stalled.yml delete mode 100644 .github/workflows/comment-labeled.yml delete mode 100644 .github/workflows/commit-lint-problem-matcher.json delete mode 100644 .github/workflows/commit-queue.yml delete mode 100644 .github/workflows/coverage-linux.yml delete mode 100644 .github/workflows/coverage-windows.yml delete mode 100644 .github/workflows/daily.yml delete mode 100644 .github/workflows/label-pr.yml delete mode 100644 .github/workflows/license-builder.yml delete mode 100644 .github/workflows/linters.yml delete mode 100644 .github/workflows/misc.yml delete mode 100644 .github/workflows/notify-force-push.yml delete mode 100644 .github/workflows/remark-lint-problem-matcher.json delete mode 100644 .github/workflows/test-asan.yml delete mode 100644 .github/workflows/test-linux.yml delete mode 100644 .github/workflows/test-macos.yml diff --git a/.github/workflows/auto-start-ci.yml b/.github/workflows/auto-start-ci.yml deleted file mode 100644 index 236e23d30f6..00000000000 --- a/.github/workflows/auto-start-ci.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -name: Auto Start CI - -on: - schedule: - # Runs every five minutes (fastest the scheduler can run). Five minutes is - # optimistic, it can take longer to run. - # To understand why `schedule` is used instead of other events, refer to - # ./doc/guides/commit-queue.md - - cron: "*/5 * * * *" - -env: - NODE_VERSION: 14.x - -jobs: - startCI: - if: github.repository == 'nodejs/node' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Install dependencies - - name: Install Node.js - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Install node-core-utils - run: npm install -g node-core-utils - - - name: Set variables - run: | - echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV - echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV - - # Get Pull Requests - - name: Get Pull Requests - uses: octokit/graphql-action@v2.x - id: get_prs_for_ci - with: - query: | - query prs($owner:String!, $repo:String!) { - repository(owner:$owner, name:$repo) { - pullRequests(labels: ["request-ci"], states: OPEN, last: 100) { - nodes { - number - } - } - } - } - owner: ${{ env.OWNER }} - repo: ${{ env.REPOSITORY }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup node-core-utils - run: | - ncu-config set username ${{ secrets.JENKINS_USER }} - ncu-config set token none - ncu-config set jenkins_token ${{ secrets.JENKINS_TOKEN }} - ncu-config set owner ${{ env.OWNER }} - ncu-config set repo ${{ env.REPOSITORY }} - - - name: Start CI - run: ./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]') diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml deleted file mode 100644 index 1f802ca12b5..00000000000 --- a/.github/workflows/build-tarball.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Build from tarball - -on: - pull_request: - push: - branches: - - master - - main - - v[0-9]+.x-staging - - v[0-9]+.x - -env: - FLAKY_TESTS: dontcare - -jobs: - build-tarball: - if: github.event.pull_request.draft == false - env: - PYTHON_VERSION: 3.9 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Make tarball - run: | - export DISTTYPE=nightly - export DATESTRING=`date "+%Y-%m-%d"` - export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA") - ./configure && make tar -j8 SKIP_XZ=1 - mkdir tarballs - mv *.tar.gz tarballs - - name: Upload tarball artifact - uses: actions/upload-artifact@v1 - with: - name: tarballs - path: tarballs - test-tarball-linux: - env: - PYTHON_VERSION: 3.9 - needs: build-tarball - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Download tarball - uses: actions/download-artifact@v1 - with: - name: tarballs - - name: Extract tarball - run: | - tar xzf tarballs/*.tar.gz - echo "TAR_DIR=`basename tarballs/*.tar.gz .tar.gz`" >> $GITHUB_ENV - - name: Copy directories needed for testing - run: | - cp -r tools/node_modules $TAR_DIR/tools - cp -r tools/eslint-rules $TAR_DIR/tools - - name: Build - run: | - cd $TAR_DIR - make build-ci -j2 V=1 - - name: Test - run: | - cd $TAR_DIR - make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml deleted file mode 100644 index dea275876ea..00000000000 --- a/.github/workflows/build-windows.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: build-windows - -on: - pull_request: - push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x - -env: - PYTHON_VERSION: 3.9 - FLAKY_TESTS: dontcare - -jobs: - build-windows: - if: github.event.pull_request.draft == false - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Install deps - run: choco install nasm - - name: Environment Information - run: npx envinfo - - name: Build - run: ./vcbuild.bat diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml deleted file mode 100644 index 916baf0463f..00000000000 --- a/.github/workflows/close-stalled.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Close stalled issues and PRs -on: - schedule: - - cron: "0 0 * * *" - -jobs: - stale: - if: github.repository == 'nodejs/node' - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-close: 30 - stale-pr-label: stalled - stale-issue-label: stalled - close-issue-message: Closing this because it has stalled. Feel free to reopen if this issue is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. - close-pr-message: Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. - # used to filter issues to check whether or not should be closed, avoids hitting maximum operations allowed if needing to paginate through all open issues - only-labels: stalled - # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits - operations-per-run: 500 - # deactivates automatic removal of stalled label if issue gets any activity - remove-stale-when-updated: false - # deactivates automatic stale labelling as we prefer to do that manually - days-before-stale: -1 diff --git a/.github/workflows/comment-labeled.yml b/.github/workflows/comment-labeled.yml deleted file mode 100644 index 14e48ea8dd3..00000000000 --- a/.github/workflows/comment-labeled.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Comment on issues and PRs when labelled -on: - issues: - types: [labeled] - pull_request_target: - types: [labeled] - -jobs: - staleComment: - if: github.repository == 'nodejs/node' && github.event.label.name == 'stalled' - runs-on: ubuntu-latest - steps: - - name: Post stalled comment - env: - COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }} - run: | - curl -X POST $COMMENTS_URL \ - -H "Content-Type: application/json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - --data '{ "body": "This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open." }' - - fastTrack: - if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'fast-track' - runs-on: ubuntu-latest - steps: - - name: Request Fast-Track - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve." diff --git a/.github/workflows/commit-lint-problem-matcher.json b/.github/workflows/commit-lint-problem-matcher.json deleted file mode 100644 index 72dd13b9e09..00000000000 --- a/.github/workflows/commit-lint-problem-matcher.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "core-validate-commit", - "pattern": [ - { - "regexp": "^not ok \\d+ (.*)$", - "message": 1 - } - ] - } - ] -} diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 3a2f4c14eb9..99d0f96055b 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -3,7 +3,7 @@ name: "Commit messages adheres to guidelines at https://goo.gl/p2fr5Q" on: [pull_request] jobs: - lint-commit-message: + with-ref: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -12,15 +12,7 @@ jobs: # Last 100 commits should be enough for a PR fetch-depth: 100 - run: git log --oneline - - name: Use Node.js 12 - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Validate commit messages - run: | - echo "::add-matcher::.github/workflows/commit-lint-problem-matcher.json" - git log --oneline ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep -v -e fixup -e squash | awk '{ print $1 }' | xargs npx -q core-validate-commit --no-validate-metadata --tap - test: + without-ref: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml deleted file mode 100644 index 25b7ea5a8cc..00000000000 --- a/.github/workflows/commit-queue.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -# This action requires the following secrets to be set on the repository: -# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below -# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes -# JENKINS_TOKEN: Jenkins token, to be used to check CI status - -name: Commit Queue - -on: - # `schedule` event is used instead of `pull_request` because when a - # `pull_request` event is triggered on a PR from a fork, GITHUB_TOKEN will - # be read-only, and the Action won't have access to any other repository - # secrets, which it needs to access Jenkins API. - schedule: - - cron: "*/5 * * * *" - -env: - NODE_VERSION: 14.x - -jobs: - commitQueue: - if: github.repository == 'nodejs/node' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - # Needs the whole git history for ncu to work - # See https://github.com/nodejs/node-core-utils/pull/486 - fetch-depth: 0 - # A personal token is required because pushing with GITHUB_TOKEN will - # prevent commits from running CI after they land. It needs - # to be set here because `checkout` configures GitHub authentication - # for push as well. - token: ${{ secrets.GH_USER_TOKEN }} - - # Install dependencies - - name: Install Node.js - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Install node-core-utils - run: npm install -g node-core-utils@latest - - - name: Set variables - run: | - echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV - echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV - echo "DEFAULT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - - - name: Get Pull Requests - uses: octokit/graphql-action@v2.x - id: get_mergable_pull_requests - with: - query: | - query release($owner:String!,$repo:String!, $base_ref:String!) { - repository(owner:$owner, name:$repo) { - pullRequests(baseRefName: $base_ref, labels: ["commit-queue"], states: OPEN, last: 100) { - nodes { - number - } - } - } - } - owner: ${{ env.OWNER }} - repo: ${{ env.REPOSITORY }} - # Commit queue is only enabled for the default branch on the repository - base_ref: ${{ env.DEFAULT_BRANCH }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Configure node-core-utils - run: | - ncu-config set branch ${DEFAULT_BRANCH} - ncu-config set upstream origin - ncu-config set username "${{ secrets.GH_USER_NAME }}" - ncu-config set token "${{ secrets.GH_USER_TOKEN }}" - ncu-config set jenkins_token "${{ secrets.JENKINS_TOKEN }}" - ncu-config set repo "${REPOSITORY}" - ncu-config set owner "${OWNER}" - - - name: Start the commit queue - run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]') diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml deleted file mode 100644 index 62881f63724..00000000000 --- a/.github/workflows/coverage-linux.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: coverage-linux - -on: - pull_request: - paths-ignore: - - 'doc/**' - - 'deps/**' - - 'benchmark/**' - - 'tools/**' - push: - branches: - - master - - main - paths-ignore: - - 'doc/**' - - 'deps/**' - - 'benchmark/**' - - 'tools/**' - -env: - PYTHON_VERSION: 3.9 - FLAKY_TESTS: dontcare - -jobs: - coverage-linux: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Install gcovr - run: pip install gcovr==4.2 - - name: Build - run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn --coverage" - # TODO(bcoe): fix the couple tests that fail with the inspector enabled. - # The cause is most likely coverage's use of the inspector. - - name: Test - run: NODE_V8_COVERAGE=coverage/tmp make test-cov -j2 V=1 TEST_CI_ARGS="-p dots" || exit 0 - - name: Report JS - run: npx c8 report --check-coverage - - name: Report C++ - run: cd out && gcovr --gcov-exclude='.*\b(deps|usr|out|obj|cctest|embedding)\b' -v -r Release/obj.target --xml -o ../coverage/coverage-cxx.xml --root=$(cd ../ && pwd) - # Clean temporary output from gcov and c8, so that it's not uploaded: - - name: Clean tmp - run: rm -rf coverage/tmp && rm -rf out - - name: Upload - uses: codecov/codecov-action@v1 - with: - directory: ./coverage diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml deleted file mode 100644 index 5387688e3c2..00000000000 --- a/.github/workflows/coverage-windows.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: coverage-windows - -on: - pull_request: - paths-ignore: - - 'doc/**' - - 'deps/**' - - 'benchmark/**' - - 'tools/**' - push: - branches: - - master - - main - paths-ignore: - - 'doc/**' - - 'deps/**' - - 'benchmark/**' - - 'tools/**' - -env: - PYTHON_VERSION: 3.9 - FLAKY_TESTS: dontcare - -jobs: - coverage-windows: - if: github.event.pull_request.draft == false - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Install deps - run: choco install nasm - - name: Environment Information - run: npx envinfo - - name: Build - run: ./vcbuild.bat - # TODO(bcoe): investigate tests that fail with coverage enabled - # on Windows. - - name: Test - run: ./vcbuild.bat test-ci-js; node -e 'process.exit(0)' - env: - NODE_V8_COVERAGE: ./coverage/tmp - - name: Report - run: npx c8 report - env: - NODE_OPTIONS: --max-old-space-size=8192 - - name: Clean tmp - run: npx rimraf ./coverage/tmp - - name: Upload - uses: codecov/codecov-action@v1 - with: - directory: ./coverage diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml deleted file mode 100644 index 3d8d66a1254..00000000000 --- a/.github/workflows/daily.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Node.js daily job - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -env: - NODE_VERSION: 14.x - -jobs: - build-lto: - runs-on: ubuntu-latest - # not working on gcc-8 and gcc-9 see https://github.com/nodejs/node/issues/38570 - container: gcc:11 - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Build lto - run: | - apt-get update && apt-get install ninja-build python-is-python3 -y - ./configure --enable-lto --ninja - ninja -C out/Release diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml deleted file mode 100644 index 4e56676e41e..00000000000 --- a/.github/workflows/label-pr.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Label PRs - -on: - pull_request_target: - types: [opened] - -jobs: - label: - runs-on: ubuntu-latest - - steps: - - uses: nodejs/node-pr-labeler@v1 - with: - configuration-path: .github/label-pr-config.yml diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml deleted file mode 100644 index 115bef9977d..00000000000 --- a/.github/workflows/license-builder.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: license update -on: - schedule: - # 00:00:00 every Monday - # https://crontab.guru/#0_0_*_*_1 - - cron: "0 0 * * 1" - workflow_dispatch: - -jobs: - update_license: - if: github.repository == 'nodejs/node' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: "./tools/license-builder.sh" # run the license builder tool - - uses: gr2m/create-or-update-pull-request-action@v1.x # create a PR or update the Action's existing PR - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - title: "doc: run license-builder" - body: "License is likely out of date. This is an automatically generated PR by the `license-builder.yml` GitHub Action, which runs `license-builder.sh` and submits a new PR or updates an existing PR." - commit-message: 'doc: run license-builder' - labels: meta diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml deleted file mode 100644 index 98a9e3374cb..00000000000 --- a/.github/workflows/linters.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: linters - -on: - pull_request: - push: - branches: - - master - - main - - v[0-9]+.x-staging - - v[0-9]+.x - -env: - PYTHON_VERSION: 3.9 - NODE_VERSION: 14.x - -jobs: - lint-addon-docs: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Lint addon docs - run: NODE=$(command -v node) make lint-addon-docs - lint-cpp: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Lint C/C++ files - run: make lint-cpp - lint-md: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Get release version numbers - if: ${{ github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }} - id: get-released-versions - run: ./tools/node-lint-md-cli-rollup/src/list-released-versions-from-changelogs.mjs - - name: Lint docs - run: | - echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" - NODE=$(command -v node) make lint-md - env: - NODE_RELEASED_VERSIONS: ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }} - - lint-js: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Lint JavaScript files - run: NODE=$(command -v node) make lint-js - lint-py: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Lint Python - run: | - make lint-py-build || true - NODE=$(command -v node) make lint-py - lint-sh: - if: github.event.pull_request.draft == false - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - run: shellcheck -V - - name: Lint Shell scripts - run: tools/lint-sh.js . - lint-codeowners: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: mszostok/codeowners-validator@v0.4.0 - with: - checks: "files,duppatterns" - lint-pr-url: - if: ${{ github.event.pull_request }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 2 - # GH Actions squashes all PR commits, HEAD^ refers to the base branch. - - run: git diff HEAD^ HEAD -G"pr-url:" -- "*.md" | ./tools/lint-pr-url.mjs ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml deleted file mode 100644 index add72b8e531..00000000000 --- a/.github/workflows/misc.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: misc - -on: - pull_request: - push: - branches: - - master - - main - - v[0-9]+.x-staging - - v[0-9]+.x - -env: - NODE_VERSION: 14.x - -jobs: - build-docs: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Build - run: NODE=$(command -v node) make doc-only - - uses: actions/upload-artifact@v1 - with: - name: docs - path: out/doc - - name: Test - run: NODE=$(command -v node) make test-doc-ci TEST_CI_ARGS="-p actions" diff --git a/.github/workflows/notify-force-push.yml b/.github/workflows/notify-force-push.yml deleted file mode 100644 index e3bdc0353c6..00000000000 --- a/.github/workflows/notify-force-push.yml +++ /dev/null @@ -1,26 +0,0 @@ -on: - push: - branches: - - master - - main - -name: Notify on Force Push -jobs: - slackNotification: - name: Slack Notification - if: ${{ github.event.forced && github.repository == 'nodejs/node' }} - runs-on: ubuntu-latest - steps: - - name: Slack Notification - uses: rtCamp/action-slack-notify@master - env: - SLACK_COLOR: '#DE512A' - SLACK_ICON: https://github.com/nodejs.png?size=48 - SLACK_TITLE: '${{ github.actor }} force-pushed to ${{ github.ref }}' - SLACK_MESSAGE: | - A commit was force-pushed to by - - Before: - After: - SLACK_USERNAME: nodejs-bot - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/remark-lint-problem-matcher.json b/.github/workflows/remark-lint-problem-matcher.json deleted file mode 100644 index cfb281310a9..00000000000 --- a/.github/workflows/remark-lint-problem-matcher.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "remark-lint", - "pattern": [ - { - "regexp": "^(?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)*$", - "file": 1 - }, - { - "regexp": "^\\s+(?:\\d+:\\d+-)?(\\d+):(\\d+)\\s+\\S*(error|warning|info)\\S*\\s+(.+)\\s+(\\S+)\\s+(?:\\S+)$", - "line": 1, - "column": 2, - "severity": 3, - "message": 4, - "code": 5, - "loop": true - } - ] - } - ] -} diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml deleted file mode 100644 index d6dd1b7b7ec..00000000000 --- a/.github/workflows/test-asan.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: test-asan - -on: - push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x - paths-ignore: - - 'doc/**' - pull_request: - paths-ignore: - - 'doc/**' - -env: - PYTHON_VERSION: 3.9 - FLAKY_TESTS: dontcare - -jobs: - test-asan: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - env: - CC: clang - CXX: clang++ - LINK: clang++ - CONFIG_FLAGS: --enable-asan - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Build - run: make build-ci -j2 V=1 - - name: Test - run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions -t 300" diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml deleted file mode 100644 index b191deb806e..00000000000 --- a/.github/workflows/test-linux.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: test-linux - -on: - pull_request: - push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x - -env: - PYTHON_VERSION: 3.9 - FLAKY_TESTS: dontcare - -jobs: - test-linux: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Build - run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" - - name: Test - run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions" diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml deleted file mode 100644 index 725a3e4a8c9..00000000000 --- a/.github/workflows/test-macos.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: test-macOS - -on: - pull_request: - paths-ignore: - - 'doc/**' - push: - branches: - - master - - main - - canary - - v[0-9]+.x-staging - - v[0-9]+.x - paths-ignore: - - 'doc/**' - -env: - PYTHON_VERSION: 3.9 - FLAKY_TESTS: dontcare - -jobs: - test-macOS: - if: github.event.pull_request.draft == false - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Build - run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" - - name: Test - run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions" From 6ac7c668ef8214465ac04540dd1d5346ba15373c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 22:13:22 +0200 Subject: [PATCH 04/14] What is commits --- .github/workflows/commit-lint.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 99d0f96055b..6f0cfea144c 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -3,20 +3,5 @@ name: "Commit messages adheres to guidelines at https://goo.gl/p2fr5Q" on: [pull_request] jobs: - with-ref: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - # Last 100 commits should be enough for a PR - fetch-depth: 100 - - run: git log --oneline - without-ref: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - # Last 100 commits should be enough for a PR - fetch-depth: 100 - - run: git log --oneline \ No newline at end of file + what-is-commit: + -run: echo ${{ github.event.pull_request.commits }} \ No newline at end of file From 3c5441e974f4e77f2c83036f518dc54f3ea5eb16 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 22:15:36 +0200 Subject: [PATCH 05/14] fixup! What is commits --- .github/workflows/commit-lint.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 6f0cfea144c..015391ee68d 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -3,5 +3,7 @@ name: "Commit messages adheres to guidelines at https://goo.gl/p2fr5Q" on: [pull_request] jobs: - what-is-commit: - -run: echo ${{ github.event.pull_request.commits }} \ No newline at end of file + checkout-with-ref: + runs-on: ubuntu-latest + steps: + - run: echo ${{ github.event.pull_request.commits }} From d9a0d0e19130c821b20fddb6e93426621c9eba72 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 22:33:36 +0200 Subject: [PATCH 06/14] Can we fetch only the right number of commit? --- .github/workflows/commit-lint.yml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 015391ee68d..390242ea266 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -3,7 +3,33 @@ name: "Commit messages adheres to guidelines at https://goo.gl/p2fr5Q" on: [pull_request] jobs: - checkout-with-ref: + fetch-depth-no-plus-one-with-ref: runs-on: ubuntu-latest steps: - - run: echo ${{ github.event.pull_request.commits }} + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ github.event.pull_request.commits }} + - run: git log --oneline + fetch-depth-plus-one-with-ref: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ github.event.pull_request.commits }} + 1 + - run: git log --oneline + fetch-depth-no-plus-one: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: ${{ github.event.pull_request.commits }} + - run: git log --oneline + fetch-depth-plus-one: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: ${{ github.event.pull_request.commits }} + 1 + - run: git log --oneline From 3915b7735c5a6a1a44c9716f83c17f83d305ba7e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 22:41:36 +0200 Subject: [PATCH 07/14] Let's try inside --- .github/workflows/commit-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 390242ea266..902336e9981 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ github.event.pull_request.commits }} + 1 + fetch-depth: ${{ github.event.pull_request.commits + 1 }} - run: git log --oneline fetch-depth-no-plus-one: runs-on: ubuntu-latest @@ -31,5 +31,5 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: ${{ github.event.pull_request.commits }} + 1 + fetch-depth: ${{ github.event.pull_request.commits + 1 }} - run: git log --oneline From 5e959213e13031a35ce776c621aff4f971eb5c98 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 22:44:17 +0200 Subject: [PATCH 08/14] insider --- .github/workflows/commit-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 902336e9981..5bae4388f59 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ github.event.pull_request.commits + 1 }} + fetch-depth: ${{ ${{ github.event.pull_request.commits }} + 1 }} - run: git log --oneline fetch-depth-no-plus-one: runs-on: ubuntu-latest @@ -31,5 +31,5 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: ${{ github.event.pull_request.commits + 1 }} + fetch-depth: ${{ ${{ github.event.pull_request.commits }} + 1 }} - run: git log --oneline From 25bd2167ba0e6612b4342e80cc50c8e2fdf17c6a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 22 Jun 2021 23:59:57 +0200 Subject: [PATCH 09/14] from JSON? --- .github/workflows/commit-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 5bae4388f59..61f356870be 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ ${{ github.event.pull_request.commits }} + 1 }} + fetch-depth: ${{ fromJSON(github.event.pull_request.commits) + 1 }} - run: git log --oneline fetch-depth-no-plus-one: runs-on: ubuntu-latest @@ -31,5 +31,5 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: ${{ ${{ github.event.pull_request.commits }} + 1 }} + fetch-depth: ${{ fromJSON(github.event.pull_request.commits) + 1 }} - run: git log --oneline From f56fd754cf10d70029ba7a35c45c657b087341e3 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 23 Jun 2021 00:08:26 +0200 Subject: [PATCH 10/14] compute the value using bash --- .github/workflows/commit-lint.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 61f356870be..2a469d64571 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -14,10 +14,13 @@ jobs: fetch-depth-plus-one-with-ref: runs-on: ubuntu-latest steps: + - name: Compute ${{ github.event.pull_request.commits }} + 1 + id: nb-of-commits + run: echo "::set-output name=nb::$((${{ github.event.pull_request.commits }} + 1))" - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ fromJSON(github.event.pull_request.commits) + 1 }} + fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - run: git log --oneline fetch-depth-no-plus-one: runs-on: ubuntu-latest @@ -29,7 +32,10 @@ jobs: fetch-depth-plus-one: runs-on: ubuntu-latest steps: + - name: Compute ${{ github.event.pull_request.commits }} + 1 + id: nb-of-commits + run: echo "::set-output name=nb::$((${{ github.event.pull_request.commits }} + 1))" - uses: actions/checkout@v2 with: - fetch-depth: ${{ fromJSON(github.event.pull_request.commits) + 1 }} + fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - run: git log --oneline From 35b41074f44d541e458ed8b69e9c6ec0d28f4404 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 23 Jun 2021 00:11:17 +0200 Subject: [PATCH 11/14] What if everything is just simpler --- .github/workflows/commit-lint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 2a469d64571..59b4bc8c4bf 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -39,3 +39,8 @@ jobs: with: fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - run: git log --oneline + fetch-default: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: git log --oneline From 3f1271b9190493a89529dd4ce73eafb9d1b6981f Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 23 Jun 2021 00:12:28 +0200 Subject: [PATCH 12/14] Maybe 2 is enough? --- .github/workflows/commit-lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 59b4bc8c4bf..b55a2c4b9d3 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -39,8 +39,9 @@ jobs: with: fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - run: git log --oneline - fetch-default: + fetch-2: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + fetch-depth: 2 - run: git log --oneline From 0647743c608d7468dd1837f4f4318b8a97d9228a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 23 Jun 2021 00:13:43 +0200 Subject: [PATCH 13/14] with with --- .github/workflows/commit-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index b55a2c4b9d3..35ff3d61f68 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -43,5 +43,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: fetch-depth: 2 - run: git log --oneline From 238d9800b2810ff93ef302b43229ecdb16b06ae2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 23 Jun 2021 00:25:20 +0200 Subject: [PATCH 14/14] Can bash work here? --- .github/workflows/commit-lint.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 35ff3d61f68..ea7d6ca19e8 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -14,13 +14,10 @@ jobs: fetch-depth-plus-one-with-ref: runs-on: ubuntu-latest steps: - - name: Compute ${{ github.event.pull_request.commits }} + 1 - id: nb-of-commits - run: echo "::set-output name=nb::$((${{ github.event.pull_request.commits }} + 1))" - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} + fetch-depth: $((${{ github.event.pull_request.commits }} + 1)) - run: git log --oneline fetch-depth-no-plus-one: runs-on: ubuntu-latest @@ -32,17 +29,7 @@ jobs: fetch-depth-plus-one: runs-on: ubuntu-latest steps: - - name: Compute ${{ github.event.pull_request.commits }} + 1 - id: nb-of-commits - run: echo "::set-output name=nb::$((${{ github.event.pull_request.commits }} + 1))" - uses: actions/checkout@v2 with: - fetch-depth: ${{ steps.nb-of-commits.outputs.nb }} - - run: git log --oneline - fetch-2: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 2 + fetch-depth: $((${{ github.event.pull_request.commits }} + 1)) - run: git log --oneline