Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit afe0729

Browse files
committed
Add GitHub Workflows for Lint and Bundle check
- Adds a GitHub Workflow that runs on PR to assert that the PR matches the lint rules. - Adds a GitHub Workflow that runs on PR to assert that the PR includes a new bundle (the dist/ folder) that matches any code changes that have happened in that PR.
1 parent 0435531 commit afe0729

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/bundle-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Bundle Check"
2+
on:
3+
pull_request:
4+
branches:
5+
- "master"
6+
jobs:
7+
check:
8+
name: "Bundle Check"
9+
runs-on: "ubuntu-22.04"
10+
steps:
11+
- name: "Checkout the current branch"
12+
uses: "actions/checkout@v3"
13+
- name: "Setup Node"
14+
uses: "actions/setup-node@v3"
15+
with:
16+
node-version: 18
17+
- name: "Install Node modules"
18+
run: "npm ci"
19+
- name: "Generate new bundle"
20+
run: "npm run package"
21+
- name: "Verify new bundle matches existing"
22+
run: "git diff --exit-code --name-only dist/"
23+
- name: "Show message instructing how to commit new bundle"
24+
if: failure()
25+
run: echo "::error title=Bundle has changed::The bundle has changed since the last commit and the new changes must be committed as part of this PR. Please run 'npm run package' and commit the results to your PR alongside your existing changes."

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Lint'
2+
on:
3+
pull_request:
4+
branches:
5+
- 'master'
6+
jobs:
7+
lint:
8+
name: 'Lint'
9+
runs-on: 'ubuntu-22.04'
10+
steps:
11+
- name: 'Checkout the current branch'
12+
uses: 'actions/checkout@v3'
13+
- name: 'Setup Node'
14+
uses: 'actions/setup-node@v3'
15+
with:
16+
node-version: 18
17+
- name: 'Install Node modules'
18+
run: 'npm ci'
19+
- name: 'Run lint'
20+
run: 'npm run lint'

0 commit comments

Comments
 (0)