vega-frontend-monorepo/.github/workflows/test.yml
Radosław Szpiech a452a6e831
Chore/use cache in GitHub jobs (#1461)
* chore: use cache v3

* chore: just cache whole node modules

* chore: download binaries instead of building them

* chore: missing directory flag

* chore: remove directory

* chore: aaah gobin

* chore: apply all improvements to other workflows

* chore: cache cypress

* fix: added mock for one failing test, removed console.log

* fix: removed increased timeout - not needed

* chore: change name back

Co-authored-by: asiaznik <artur@vegaprotocol.io>
2022-09-23 15:56:47 +02:00

45 lines
1.2 KiB
YAML

name: Unit tests & build
on:
push:
branches:
- develop
- main
pull_request:
jobs:
pr:
name: Test and lint - PR
runs-on: ubuntu-latest
permissions:
contents: 'read'
actions: 'read'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: ${{ github.base_ref }}
- name: Use Node.js 16
id: Node
uses: actions/setup-node@v3
with:
node-version: 16.14.0
- name: Restore node_modules from cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node_modules-${{ hashFiles('**/yarn.lock') }}
- name: Install root dependencies
run: yarn install --frozen-lockfile
- name: Check formatting
run: yarn nx format:check
- name: Lint affected
run: yarn nx affected:lint --max-warnings=0
- name: Test affected
run: yarn nx affected:test
- name: Build affected
run: yarn nx affected:build