From 6326bf4d398b317f12405cdc8cd7d273d8fb32f5 Mon Sep 17 00:00:00 2001 From: Matt Weber <1062734+mweberxyz@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:38:10 -0400 Subject: [PATCH] chore: add nightly tests Closes nodejs/undici#2932 --- .github/workflows/nightly.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000000..deabbc6dc78 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,62 @@ +name: Nightly tests + +on: + workflow_dispatch: + schedule: + - cron: "0 10 * * *" + +jobs: + test: + if: github.repository == 'nodejs/undici' + strategy: + fail-fast: false + max-parallel: 0 + matrix: + runs-on: + - ubuntu-latest + - windows-latest + - macos-latest + uses: ./.github/workflows/test.yml + with: + node-version: 22-nightly + runs-on: ${{ matrix.runs-on }} + secrets: inherit + + report-failure: + if: failure() + needs: test + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Create or update issue + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const ISSUE_TITLE = "Nightly tests are failing" + + const actionRunUrl = "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + + const issueContext = { + owner: context.repo.owner, + repo: context.repo.repo + } + + let issue = (await github.rest.issues.listForRepo({ + state: "open", + creator: "github-actions[bot]", + ...issueContext + })).data.find((issue) => issue.title === ISSUE_TITLE) + + if(!issue) { + issue = (await github.rest.issues.create({ + title: ISSUE_TITLE, + ...issueContext + })).data + } + + await github.rest.issues.createComment({ + issue_number: issue.number, + body: `Tests against nightly failed, see: ${actionRunUrl}`, + ...issueContext + });