131 lines (130 loc) · 3.54 KB
/
continuous-integration.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Continuous Integration
on:
# branches pushed by collaborators
push:
branches:
- master
# pull request from non-collaborators
pull_request: {}
# nightly
schedule:
- cron: '0 0 * * *'
jobs:
lint-build:
name: "Lint & Build"
runs-on: ubuntu-latest
steps:
# checkout code
- uses: actions/checkout@v2
# install node
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
# lint, build, test
- run: npm install
- run: npm run lint
- run: npm run build
- name: Upload package artifact
uses: actions/upload-artifact@v1
with:
name: ts-node-packed.tgz
path: tests/ts-node-packed.tgz
test:
needs: lint-build
name: "Test: ${{ matrix.os }}, node ${{ matrix.node }}, TS ${{ matrix.typescript }}"
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows]
flavor: [1, 2, 3, 4, 5, 6, 7, 8, 9]
include:
- flavor: 1
node: 10
nodeFlag: 10
typescript: latest
typescriptFlag: latest
- flavor: 2
node: 12.15
nodeFlag: 12_15
typescript: latest
typescriptFlag: latest
- flavor: 3
node: 12.16
nodeFlag: 12_16
typescript: latest
typescriptFlag: latest
- flavor: 4
node: 13
nodeFlag: 13
typescript: latest
typescriptFlag: latest
- flavor: 5
node: 13
nodeFlag: 13
typescript: 2.7
typescriptFlag: 2_7
- flavor: 6
node: 13
nodeFlag: 13
typescript: next
typescriptFlag: next
- flavor: 7
node: 14
nodeFlag: 14
typescript: latest
typescriptFlag: latest
- flavor: 8
node: 14
nodeFlag: 14
typescript: 2.7
typescriptFlag: 2_7
- flavor: 9
node: 14
nodeFlag: 14
typescript: next
typescriptFlag: next
steps:
# checkout code
- uses: actions/checkout@v2
# install node
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
# lint, build, test
- run: npm install
- run: npm run build-nopack
- name: Download package artifact
uses: actions/download-artifact@v1
with:
name: ts-node-packed.tgz
path: tests/
- run: npm install typescript@${{ matrix.typescript }} --force
- run: npm run test-cov
- run: npm run coverage-report
if: ${{ always() }}
- name: Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v1
with:
flags: ${{ matrix.os }},node_${{ matrix.nodeFlag }},typescript_${{ matrix.typescriptFlag }}
- run: npm run coverage-fix-paths
- run: npm run coverage-report
- name: Coveralls
if: ${{ always() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel: true
finish:
needs: test
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true