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/**
- cypress/**
- ee/**
- frontend/**
- pkg/**
- server/**
- tools/**
- go.mod
- go.sum
- package.json
- yarn.lock
- docker-compose.yml
- webpack.config.js
- tsconfig.json
2022-12-23 17:37:03 +00:00
- .github/workflows/test.yml
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
2022-08-31 10:44:22 +00:00
uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
2021-03-05 01:13:28 +00:00
- name : JS Dependency Cache
2021-04-16 23:14:56 +00:00
id : js-cache
2022-08-31 10:41:09 +00:00
uses : actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2
2021-03-05 01:13:28 +00:00
with :
path : |
**/node_modules
~/.cache/Cypress
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 : |
make test-js
lint-js :
strategy :
matrix :
os : [ ubuntu-latest]
runs-on : ${{ matrix.os }}
steps :
- name : Checkout Code
2022-08-31 10:44:22 +00:00
uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
2021-03-05 01:13:28 +00:00
- name : JS Dependency Cache
2021-04-16 23:14:56 +00:00
id : js-cache
2022-08-31 10:41:09 +00:00
uses : actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2
2021-03-05 01:13:28 +00:00
with :
path : |
**/node_modules
~/.cache/Cypress
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