From 2c215e8753498af9c12349b4620e6525b1a02648 Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Wed, 10 Jan 2024 10:47:51 +0100 Subject: [PATCH] ci: add a build of the npm package in PR checks --- .github/workflows/checks.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c4e0dd39e4..4ebeaa5ed0 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -166,3 +166,28 @@ jobs: - name: Run tests run: npx nx run-many --target=e2e + + build-npm-package: + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' + name: Attempt to build the NPM package + runs-on: ubuntu-latest + + steps: + - name: Checkout branch + uses: actions/checkout@v3 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build NPM package + working-directory: package + run: node generate-package.js