-
-
Notifications
You must be signed in to change notification settings - Fork 16
102 lines (98 loc) · 2.79 KB
/
module.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: module
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
strategy:
matrix:
node: [ '10', '12', '14', '16' ]
name: test/node v${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node v${{ matrix.node }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm i
- name: Run Tests
run: npm test
coverage:
name: Code Coverage
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
- name: Install Dependencies
run: npm i
- name: Run Tests
if: ${{ github.event_name == 'pull_request' }}
run: npm test
- name: Comment Coverage on PR
if: ${{ github.event_name == 'pull_request' }}
uses: artiomtr/jest-coverage-report-action@fdabb5bd42fa8a55bcfdfb55d855122cabfb7911
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
threshold: 100
- name: Upload Coverage to Code Climate
uses: paambaati/[email protected]
if: ${{ github.event_name == 'push' }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm test
coverageLocations: |
${{ github.workspace }}/coverage/lcov.info:lcov
eslint:
name: ESLint Check
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
- name: Install Dependencies
run: npm i
- name: Delete expired artifacts
uses: LKP-RnD/purge-expired-artifacts-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo_to_purge: "KyleRoss/node-lambda-log"
dry_run: "false"
- uses: bradennapier/[email protected]
with:
includeGlob: 'index.js,index.test.js,lib/*.js'
release:
name: Release
if: ${{ github.event_name == 'push' }}
needs: [ test, coverage ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
- name: Install Dependencies
run: npm i
- name: Publish to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release