Skip to content

Commit

Permalink
Check the dist/ folder in a separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gordon committed Feb 10, 2022
1 parent 8ba73ea commit 7db94e5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 11 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'releases/*'

jobs:
build: # make sure build/ci work properly
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -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

0 comments on commit 7db94e5

Please sign in to comment.