From d5a7585ef051f0da11e8e5be58226322e131f007 Mon Sep 17 00:00:00 2001 From: Cameron Clough Date: Mon, 31 Oct 2022 20:00:29 -0700 Subject: [PATCH] add GitHub actions workflow (#16) * build and check dist folder * test that it works * Revert "test that it works" This reverts commit 86fa96f1e67cbd6cb8ad7d7b222a62c4d1f6b66f. --- .github/workflows/build.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..72a1b82 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,33 @@ +name: build + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + + - name: Setup Node 16 + uses: actions/setup-node@v3 + with: + node-version: '16' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --immutable --immutable-cache --check-cache + + - name: Run linter checks + run: yarn lint + + - name: Rebuild the dist/ directory + run: yarn build + + - name: Compare the expected and actual dist/ directories + run: | + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "The dist/ directory is out of date. Please run 'yarn build' and commit the changes." + echo "See status below:" + git diff + exit 1 + fi