-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: run tests daily against node nightly (#2969)
* chore(.github/workflows): factor out test running * chore: add nightly tests Closes #2932
- Loading branch information
Showing
3 changed files
with
121 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Run tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
node-version: | ||
required: true | ||
type: string | ||
runs-on: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test: | ||
name: Test with Node.js ${{ inputs.node-version }} on ${{ inputs.runs-on }} | ||
timeout-minutes: 15 | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js@${{ inputs.node-version }} | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- name: Print version information | ||
run: | | ||
echo OS: $(node -p "os.version()") | ||
echo Node.js: $(node --version) | ||
echo npm: $(npm --version) | ||
echo git: $(git --version) | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Print installed dependencies | ||
run: npm ls --all | ||
continue-on-error: true | ||
|
||
- name: Run tests | ||
run: npm run coverage:ci | ||
env: | ||
CI: true | ||
NODE_V8_COVERAGE: ./coverage/tmp | ||
|
||
- name: Coverage Report | ||
if: inputs.runs-on == 'ubuntu-latest' && inputs.node-version == 20 | ||
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |