From 409222c82f1452b7bc4157739840864284f5892f Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Tue, 27 Aug 2024 17:32:07 +0200 Subject: [PATCH] ci: make autobahn workflow reusable workflow, run the autobahn on nightly tests (#3503) * ci: make autobahn workflow reusable workflow * Apply suggestions from code review * wroom wroom * wroom wroom --- .github/workflows/autobahn.yml | 12 ++++++++---- .github/workflows/nightly.yml | 8 ++++++++ .github/workflows/triggered-autobahn.yml | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/triggered-autobahn.yml diff --git a/.github/workflows/autobahn.yml b/.github/workflows/autobahn.yml index 6048bd5bdf4..df77a5f57f9 100644 --- a/.github/workflows/autobahn.yml +++ b/.github/workflows/autobahn.yml @@ -1,13 +1,17 @@ name: Autobahn + on: workflow_dispatch: - + workflow_call: + inputs: + node-version: + default: '22' + type: string pull_request: paths: - '.github/workflows/autobahn.yml' - 'lib/web/websocket/**' - 'test/autobahn/**' - permissions: contents: read pull-requests: write @@ -39,10 +43,10 @@ jobs: with: args: docker restart --time 0 --signal=SIGKILL fuzzingserver - - name: Setup Node + - name: Setup Node.js@${{ inputs.node-version || '22' }} uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: 22 + node-version: ${{ inputs.node-version || '22' }} - name: Run Autobahn Test Suite run: npm run test:websocket:autobahn diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 307b1134ead..7da843a9e6e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,6 +17,13 @@ jobs: runs-on: ubuntu-latest secrets: inherit + test-autobahn: + if: github.repository == 'nodejs/undici' + uses: ./.github/workflows/autobahn.yml + with: + node-version: 23-nightly + secrets: inherit + test-windows: if: github.repository == 'nodejs/undici' uses: ./.github/workflows/test.yml @@ -39,6 +46,7 @@ jobs: - test-linux - test-windows - test-macos + - test-autobahn runs-on: ubuntu-latest permissions: issues: write diff --git a/.github/workflows/triggered-autobahn.yml b/.github/workflows/triggered-autobahn.yml new file mode 100644 index 00000000000..d8100bb61bf --- /dev/null +++ b/.github/workflows/triggered-autobahn.yml @@ -0,0 +1,16 @@ +name: Autobahn + +on: + pull_request: + types: + - labeled + +permissions: + contents: read + pull-requests: write + +jobs: + autobahn: + if: ${{ github.event.label.name == 'autobahn' }} + name: Autobahn Test Suite + uses: ./.github/workflows/autobahn.yml