-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (62 loc) · 2.28 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
main:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v2
name: Checkout [master]
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: 'master'
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: pnpm
- run: pnpm install --frozen-lockfile --non-interactive --no-progress --prefer-offline
- run: npx nx affected --target=lint --parallel --max-parallel=3
- run: npx nx affected --target=build --parallel --max-parallel=3
- run: npx nx affected --target=test --parallel --max-parallel=2 --code-coverage
- run: npx nx affected --target=e2e --parallel --max-parallel=2
- name: Codecov upload
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- run: |
git fetch --no-tags --prune origin master
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: 'master'
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: pnpm
- run: pnpm install --frozen-lockfile --non-interactive --no-progress --prefer-offline
- run: npx nx affected --base=origin/master --target=lint --parallel --max-parallel=3
- run: npx nx affected --base=origin/master --target=build --parallel --max-parallel=3
- run: npx nx affected --base=origin/master --target=test --parallel --max-parallel=2 --code-coverage
- run: npx nx affected --base=origin/master --target=e2e --parallel --max-parallel=2
- name: Clean before merge
run: pnpm cleanBeforeMerge
- name: Codecov upload
uses: codecov/codecov-action@v2
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}