From 7db94e52afd3326f9534247555e40b10ca318439 Mon Sep 17 00:00:00 2001 From: Barry Gordon Date: Thu, 10 Feb 2022 21:04:55 +0000 Subject: [PATCH] Check the dist/ folder in a separate workflow --- .github/workflows/check-dist.yml | 45 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 12 +-------- 2 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/check-dist.yml diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml new file mode 100644 index 0000000..21e40bf --- /dev/null +++ b/.github/workflows/check-dist.yml @@ -0,0 +1,45 @@ +name: Check dist/ + +on: + pull_request: + push: + branches: + - main + - 'releases/*' + +jobs: + verify-build: # make sure the checked in dist/ folder matches the output of a rebuild + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Read .nvmrc + id: nvm + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ steps.nvm.outputs.NVMRC }} + + - name: Install NPM dependencies + run: npm ci + + - name: Rebuild the dist/ directory + run: npm run package + + - name: Compare the expected and actual dist/ directories + run: git diff --quiet dist/ + verify-index-js: # make sure the entrypoint js files run on a clean machine without compiling first + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - uses: ./ + with: + milliseconds: 1000 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a09a76..9bd5b09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: - 'releases/*' jobs: - build: # make sure build/ci work properly + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -37,13 +37,3 @@ jobs: run: npm run test - run: git diff --quiet dist/ - test: # make sure the action works on a clean machine without building - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - uses: ./ - with: - milliseconds: 1000