fleet/.github/workflows/test.yml

102 lines
2.3 KiB
YAML
Raw Normal View History

name: Run Tests
on:
push:
branches:
- main
2021-10-18 21:49:32 +00:00
- patch-*
pull_request:
paths:
- assets/**
- cypress/**
- ee/**
- frontend/**
- pkg/**
- server/**
- tools/**
- go.mod
- go.sum
- package.json
- yarn.lock
- docker-compose.yml
- webpack.config.js
- tsconfig.json
- .github/workflows/test.yml
2021-10-18 21:49:32 +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
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
permissions:
contents: read
jobs:
test-js:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
- name: JS Dependency Cache
id: js-cache
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2
with:
path: |
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-
- name: Install JS Dependencies
if: steps.js-cache.outputs.cache-hit != 'true'
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
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
- name: JS Dependency Cache
id: js-cache
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v2
with:
path: |
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-
- name: Install JS Dependencies
if: steps.js-cache.outputs.cache-hit != 'true'
run: make deps-js
- name: Run JS Linting
run: |
make lint-js
- name: Run prettier formatting check
run: |
yarn prettier:check