-
Notifications
You must be signed in to change notification settings - Fork 35
58 lines (49 loc) · 1.8 KB
/
ci.yml
File metadata and controls
58 lines (49 loc) · 1.8 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
name: ci
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
- name: Install NPM dependencies 📦
uses: bahmutov/npm-install@v1
- name: Unit tests 🧪
run: npm test
- name: Check all covered files 📊
run: |
node bin/check-coverage main1.js
node bin/check-coverage to/main2.js
node bin/only-covered main1.js main2.js
# and can check multiple files at once
node bin/check-coverage main1.js main2.js
- name: Check totals 🛡
run: node bin/check-total --min 30
- name: Set commit status using REST
# https://developer.github.com/v3/repos/statuses/
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "success",
"description": "REST commit status",
"context": "a test"
}'
- name: Set code coverage commit status 📫
run: node bin/set-gh-status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check coverage change from README 📫
run: node bin/set-gh-status --check-against-readme
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update code coverage badge 🥇
run: node bin/update-badge
- name: Semantic Release 🚀
uses: cycjimmy/semantic-release-action@v3
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}