-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpull-request.yaml
More file actions
78 lines (67 loc) · 2.02 KB
/
pull-request.yaml
File metadata and controls
78 lines (67 loc) · 2.02 KB
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
68
69
70
71
72
73
74
75
76
77
name: On PR to Main
on:
pull_request:
branches: [main]
jobs:
pr_pipeline:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch Code
run: git fetch origin main
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install Dependencies
run: npm ci
- name: Build (Nx Affected)
uses: mansagroup/nrwl-nx-action@v2
with:
targets: build
affected: true
nxCloud: false
- name: Lint (Nx Affected)
uses: mansagroup/nrwl-nx-action@v2
with:
targets: lint
affected: true
nxCloud: false
- name: Test with Coverage (Nx Affected)
uses: mansagroup/nrwl-nx-action@v2
with:
targets: test
affected: true
nxCloud: false
args: '--coverage --coverageReporters=json,json-summary'
- name: Download Artifact (base code coverage results)
uses: dawidd6/action-download-artifact@v2
id: restoreCodeCoverage
with:
workflow: main-push.yaml
workflow_conclusion: success
branch: main
name: code-coverage-report
path: ./coverage-base
continue-on-error: true
- name: Comment Code Coverage on PR
uses: dkhunt27/nx-code-coverage@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
no-coverage-ran: false
coverage-folder: ./coverage
coverage-base-folder: ./coverage-base
gist-processing: true
gist-token: ${{ secrets.COVERAGE_BADGES_GIST_TOKEN }}
gist-id: SOME_GIST_ID
color: green
named-logo: jest
hide-coverage-reports: false
hide-unchanged: false