generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 105
60 lines (51 loc) · 1.89 KB
/
integrity-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This workflow runs a handful of integrity checks.
# when:
# - a pull request is opened against main
# - commits are pushed to main
# what:
# - transpiles ts -> js and builds browser bundles to ensure everything builds without error.
# - runs type checker
# - runs tests (currently in node environment only)
# - runs linter. Will fail if there are any warnings
name: Continuous Integration Checks
on:
push:
branches: [main]
pull_request:
branches: [main]
# used to run action manually via the UI
workflow_dispatch:
jobs:
security-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.16.0
uses: actions/setup-node@v3
with:
node-version: 18.16.0
- run: npm audit
build:
runs-on: ubuntu-latest
# read more about matrix strategies here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
strategy:
matrix:
node-version: [18.16.0, 20.3.0]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# https://docs.npmjs.com/cli/v8/commands/npm-ci
- run: npm clean-install
# check the licences allow list to avoid incorrectly licensed dependencies creeping in:
- run: npm run license-check
# builds all bundles
- run: npm run build
# runs linter. Job will fail if there are any warnings or errors
- run: npm run lint
# runs tests in node environment without attempting to generate code coverage badges
- run: npm run test:node:ci
# runs code coverage badge generation, throws if README output differs to README to be checked in (thus detects if tests were not run)
- run: npm run make-coverage-badges:ci