2022-05-25 10:05:13 +00:00
|
|
|
name: Unit tests & build
|
2022-03-22 13:11:01 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
2022-09-23 13:56:47 +00:00
|
|
|
- main
|
2022-03-22 13:11:01 +00:00
|
|
|
pull_request:
|
|
|
|
jobs:
|
|
|
|
pr:
|
|
|
|
name: Test and lint - PR
|
|
|
|
runs-on: ubuntu-latest
|
2022-09-02 13:00:29 +00:00
|
|
|
permissions:
|
|
|
|
contents: 'read'
|
|
|
|
actions: 'read'
|
2022-03-22 13:11:01 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-09-02 13:00:29 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-03-22 13:11:01 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Derive appropriate SHAs for base and head for `nx affected` commands
|
|
|
|
uses: nrwl/nx-set-shas@v2
|
|
|
|
with:
|
2022-09-23 13:56:47 +00:00
|
|
|
main-branch-name: ${{ github.base_ref }}
|
2022-03-22 13:11:01 +00:00
|
|
|
- name: Use Node.js 16
|
|
|
|
id: Node
|
2022-09-02 13:00:29 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-03-22 13:11:01 +00:00
|
|
|
with:
|
2023-02-22 12:11:35 +00:00
|
|
|
node-version: 16.15.1
|
2022-09-23 13:56:47 +00:00
|
|
|
- name: Restore node_modules from cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: '**/node_modules'
|
|
|
|
key: node_modules-${{ hashFiles('**/yarn.lock') }}
|
2022-03-22 13:11:01 +00:00
|
|
|
- name: Install root dependencies
|
2022-09-23 13:56:47 +00:00
|
|
|
run: yarn install --frozen-lockfile
|
2022-03-22 13:11:01 +00:00
|
|
|
- name: Check formatting
|
|
|
|
run: yarn nx format:check
|
2022-03-30 09:49:48 +00:00
|
|
|
- name: Lint affected
|
2022-03-31 15:42:12 +00:00
|
|
|
run: yarn nx affected:lint --max-warnings=0
|
2022-03-30 09:49:48 +00:00
|
|
|
- name: Test affected
|
2022-03-22 13:11:01 +00:00
|
|
|
run: yarn nx affected:test
|
2022-03-30 09:49:48 +00:00
|
|
|
- name: Build affected
|
2022-03-22 13:11:01 +00:00
|
|
|
run: yarn nx affected:build
|
2022-10-25 07:41:16 +00:00
|
|
|
- name: Build affected spec
|
|
|
|
run: yarn nx affected --target=build-spec
|