diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000000..65c926a11db --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,43 @@ +name: Nightly tests + +on: + - workflow_dispatch + - schedule: + - cron: "55 18 * * *" + +jobs: + test: + if: github.repository == 'mweberxyz/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 + + create-issue: + if: failure() + needs: test + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Create issue + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const url = "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: `Nightly tests failed - ${new Date().toISOString().substring(0, 10)}`, + body: `Refer to ${url} for details` + }); diff --git a/test/trailers.js b/test/trailers.js index 8f616e87eba..067159d6214 100644 --- a/test/trailers.js +++ b/test/trailers.js @@ -6,7 +6,7 @@ const { Client } = require('..') const { createServer } = require('node:http') test('response trailers missing is OK', async (t) => { - t = tspl(t, { plan: 1 }) + t = tspl(t, { plan: 2 }) const server = createServer((req, res) => { res.writeHead(200, { @@ -25,6 +25,7 @@ test('response trailers missing is OK', async (t) => { }) t.strictEqual(await body.text(), 'response') + t.strictEqual('abc', 'xyz') }) await t.completed