-
Notifications
You must be signed in to change notification settings - Fork 128
74 lines (62 loc) · 2.02 KB
/
pr-tests.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
68
69
70
71
72
73
74
name: PR CI
on:
pull_request:
branches:
- master
- beta
- next
paths:
- "./.github/**.yml"
- "**/packages/**.js"
- "**/packages/**/package.json"
- "test/**/*.js"
- "ci/**/*.js"
jobs:
pr-tests:
name: Install, lint, test, report coverage changes
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18.x]
os: [ubuntu-latest, windows-latest]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout actions
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git checkout -b master origin/master
git checkout -
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Install
run: npm ci
- name: Lint
run: npm run lint:ci
- name: Unit tests
run: npm test
- name: E2E tests
run: npm run test:e2e
- name: Run Coverage
if: ${{ matrix.os == 'ubuntu-latest' && github.triggering_actor != 'dependabot[bot]' }}
run: npm run cov:changes:json && npm run cov:changes:2:md
- name: Find previous coverage report comment
if: ${{ matrix.os == 'ubuntu-latest' && github.triggering_actor != 'dependabot[bot]' }}
uses: peter-evans/find-comment@v1
id: findcomment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Coverage Report
- name: Create or update previous coverage report comment
if: ${{ matrix.os == 'ubuntu-latest' && github.triggering_actor != 'dependabot[bot]' }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.findcomment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: .branch-coverage-changes.md
edit-mode: replace