From 74eb9f2e7f227eb915a84547a3b709b164548c29 Mon Sep 17 00:00:00 2001 From: Romaric Pascal Date: Tue, 30 Apr 2024 16:03:52 +0100 Subject: [PATCH] Add GitHub workflow for checking integration with bundlers --- .github/workflows/bundler-integrations.yml | 41 ++++++++++++++++++++++ .github/workflows/tests.yml | 8 +++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/bundler-integrations.yml diff --git a/.github/workflows/bundler-integrations.yml b/.github/workflows/bundler-integrations.yml new file mode 100644 index 0000000000..6ffe28485f --- /dev/null +++ b/.github/workflows/bundler-integrations.yml @@ -0,0 +1,41 @@ +name: Bundler integrations + +on: + workflow_call: + workflow_dispatch: + +jobs: + install: + name: Install + runs-on: ubuntu-latest + + env: + PUPPETEER_SKIP_DOWNLOAD: true + + strategy: + fail-fast: false + + matrix: + bundler: + - rollup + - webpack + - vite + + steps: + - name: Checkout + uses: actions/checkout@v4.1.4 + + - name: Restore dependencies + uses: ./.github/workflows/actions/install-node + + - name: Build GOV.UK Frontend + uses: ./.github/workflows/actions/build + + - name: Build with bundler + run: npm run ${{matrix.bundler}} -w @govuk-frontend/bundler-integrations + + # Check output for modules that should not be included + - name: Check output + working-directory: ./.github/workflows/bundler-integrations + run: | + grep -v "Accordion" dist/${{matrix.bundler}}/*.js diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c013a27fc..34b7de638f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -324,3 +324,11 @@ jobs: # Run existing "Stats comment" workflow # (after only install has been cached) uses: ./.github/workflows/stats-comment.yml + + bundler-integrations: + name: Bundler integrations + needs: [install, build] + + # Run existing "Bundler integrations" workflow + # (after install and build have been cached) + uses: ./.github/workflows/bundler-integrations.yml