Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: PR checks

on: pull_request

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HUSKY_SKIP_INSTALL: true

jobs:
eslint:
name: Code quality
runs-on: ubuntu-18.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Restore node_modules cache
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
run: yarn
- name: ESLint
run: yarn eslint

tests:
name: Unit tests
runs-on: ubuntu-18.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Restore node_modules cache
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
run: yarn
- name: All tests
run: yarn test
- name: Add coverage comment
uses: ScaCap/code-coverage-assistant@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info

build:
name: Check build is committed
runs-on: ubuntu-18.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Restore node_modules cache
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
run: yarn
- name: Build
run: yarn build
- name: Ensure that the committed dist matches the build
# See if there are any diffs in the dist file. Grep returns an error
# when there are no changes, so we flip the output
run: (git diff --name-only | grep dist/main.js || exit 0 && exit 1)
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

dist/*
package.json
.eslintrc.json
.github/
Expand Down
Loading