-
Notifications
You must be signed in to change notification settings - Fork 154
46 lines (45 loc) · 1.35 KB
/
on-pull-request.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
name: on-pull-request
on:
pull_request
jobs:
on_pr:
runs-on: ubuntu-latest
env:
NODE_ENV: dev
steps:
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: "Setup npm"
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
- name: Install packages
run: |
npm ci
npm run lerna-ci
- name: Run lint
run: npm run lerna-lint
- name: Run tests
run: npm run lerna-test
- name: Collate Coverage Reports
if: ${{ github.actor != 'dependabot[bot]' }}
run: |
for d in ./packages/*/ ; do
mkdir -p coverage
if [[ ! -f coverage/lcov.info ]]
then
continue
fi
filename="$d""coverage/lcov.info"
targetSource="SF:""$d""src"
sed "s|SF:src|$targetSource|g" $filename >> coverage/lcov.info
done
- name: Report Coverage
#Dependabot user will only have read-only perms, so don't try to report coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: romeovs/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info