From a69d6adb47c6759ed63969da6455574c920f756a Mon Sep 17 00:00:00 2001 From: uzlopak Date: Tue, 24 Oct 2023 23:37:25 +0200 Subject: [PATCH 1/2] improve workflow with fastify-integration job --- .github/workflows/plugins-ci.yml | 42 +++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugins-ci.yml b/.github/workflows/plugins-ci.yml index 921fda4..0e5a4e3 100644 --- a/.github/workflows/plugins-ci.yml +++ b/.github/workflows/plugins-ci.yml @@ -23,6 +23,11 @@ on: required: false default: false type: boolean + fastify-integration: + description: 'Set to true to run fastify tests with the (proposed) changes.' + required: false + default: false + type: boolean jobs: dependency-review: @@ -120,12 +125,47 @@ jobs: - name: Run tests run: npm test + fastify-integration: + name: Test Fastify Integration + runs-on: ubuntu-latest + if: > + !failure() && + !cancelled() && + inputs.fastify-integration == true + permissions: + contents: read + steps: + - name: Check out repo + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: lts/* + + - name: Install dependencies + run: npm i --ignore-scripts + + - name: Test Fastify Integration + run: | + npm link && + PACKAGE_NAME=$(node -p "require('./package.json').name") + git clone https://github.com/fastify/fastify.git --depth 1 && + cd fastify && + npm i --ignore-scripts && + npm link $PACKAGE_NAME && + npm run unit + automerge: name: Automerge Dependabot PRs if: > github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' - needs: test + needs: + - test + - fastify-integration permissions: pull-requests: write contents: write From 8ed652e46cede025605eb52ee77410278434e555 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Wed, 25 Oct 2023 10:29:26 +0200 Subject: [PATCH 2/2] ensure fastify-dependency-integration does not skip automerge --- .github/workflows/plugins-ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/plugins-ci.yml b/.github/workflows/plugins-ci.yml index 0e5a4e3..500b604 100644 --- a/.github/workflows/plugins-ci.yml +++ b/.github/workflows/plugins-ci.yml @@ -23,7 +23,7 @@ on: required: false default: false type: boolean - fastify-integration: + fastify-dependency-integration: description: 'Set to true to run fastify tests with the (proposed) changes.' required: false default: false @@ -125,13 +125,13 @@ jobs: - name: Run tests run: npm test - fastify-integration: + fastify-dependency-integration: name: Test Fastify Integration runs-on: ubuntu-latest if: > !failure() && !cancelled() && - inputs.fastify-integration == true + inputs.fastify-dependency-integration == true permissions: contents: read steps: @@ -161,11 +161,14 @@ jobs: automerge: name: Automerge Dependabot PRs if: > + always() && + needs.test.result == 'success' && + (needs.fastify-dependency-integration.result == 'success' || needs.fastify-dependency-integration.result == 'skipped') && github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' needs: - test - - fastify-integration + - fastify-dependency-integration permissions: pull-requests: write contents: write