2022-10-07 15:43:56 +00:00
name : Run Tests
2021-07-13 20:15:38 +00:00
on :
push :
branches :
- main
2021-10-18 21:49:32 +00:00
- patch-*
2021-07-13 20:15:38 +00:00
pull_request :
2022-01-13 18:48:26 +00:00
paths :
- assets/**
- frontend/**
- package.json
- yarn.lock
- webpack.config.js
- tsconfig.json
2021-10-18 21:49:32 +00:00
2022-10-24 20:01:00 +00:00
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency :
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
cancel-in-progress : true
2022-10-07 15:43:56 +00:00
defaults :
run :
# fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell : bash
2021-10-18 21:49:32 +00:00
2022-03-25 18:19:42 +00:00
permissions :
contents : read
2021-03-05 01:13:28 +00:00
jobs :
test-js :
strategy :
matrix :
os : [ ubuntu-latest]
runs-on : ${{ matrix.os }}
steps :
- name : Checkout Code
2023-08-31 17:09:21 +00:00
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2021-03-05 01:13:28 +00:00
- name : JS Dependency Cache
2021-04-16 23:14:56 +00:00
id : js-cache
2023-03-02 21:51:13 +00:00
uses : actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
2021-03-05 01:13:28 +00:00
with :
path : |
**/node_modules
key : ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys : |
${{ runner.os }}-modules-
- name : Install JS Dependencies
2021-04-16 23:14:56 +00:00
if : steps.js-cache.outputs.cache-hit != 'true'
2021-03-05 01:13:28 +00:00
run : make deps-js
- name : Run JS Tests
run : |
2023-06-01 16:46:25 +00:00
yarn test:ci
2021-03-05 01:13:28 +00:00
2023-06-01 16:46:25 +00:00
- name : Upload to Codecov
uses : codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with :
flags : frontend
2021-03-05 01:13:28 +00:00
lint-js :
strategy :
matrix :
os : [ ubuntu-latest]
runs-on : ${{ matrix.os }}
steps :
- name : Checkout Code
2023-08-31 17:09:21 +00:00
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2021-03-05 01:13:28 +00:00
- name : JS Dependency Cache
2021-04-16 23:14:56 +00:00
id : js-cache
2023-03-02 21:51:13 +00:00
uses : actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
2021-03-05 01:13:28 +00:00
with :
path : |
**/node_modules
key : ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys : |
${{ runner.os }}-modules-
- name : Install JS Dependencies
2021-04-16 23:14:56 +00:00
if : steps.js-cache.outputs.cache-hit != 'true'
2021-03-05 01:13:28 +00:00
run : make deps-js
- name : Run JS Linting
run : |
make lint-js
2021-04-12 13:32:25 +00:00
2021-04-16 23:14:56 +00:00
- name : Run prettier formatting check
run : |
yarn prettier:check