Skip to content

Commit c581e2f

Browse files
committed
add gh actions ci
1 parent d058745 commit c581e2f

File tree

1 file changed

+128
-0
lines changed

1 file changed

+128
-0
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Continuous Integration
2+
on:
3+
# branches pushed by collaborators
4+
push:
5+
branches:
6+
- master
7+
# pull request from non-collaborators
8+
pull_request: {}
9+
# nightly
10+
schedule:
11+
- cron: '0 0 * * *'
12+
jobs:
13+
build:
14+
name: "Test: ${{ matrix.os }}, node ${{ matrix.node }}"
15+
runs-on: ${{ matrix.os }}-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu, windows]
20+
node:
21+
- 16
22+
- 14
23+
- 12
24+
- 10
25+
- 9
26+
- '8'
27+
- '7'
28+
- '6'
29+
- '4'
30+
- '0.12'
31+
- '0.10'
32+
steps:
33+
# checkout code
34+
- uses: actions/checkout@v2
35+
# install node
36+
- name: Use Node.js ${{ matrix.os }}
37+
uses: actions/setup-node@v1
38+
with:
39+
node-version: ${{ matrix.node }}
40+
41+
# npm install with caching
42+
- run: |
43+
npm config set cache "$( node -p "process.cwd()" )/temp/npm-cache"
44+
- name: Cache dependencies
45+
uses: actions/cache@v2
46+
with:
47+
path: temp/npm-cache
48+
key: npm-cache-${{ matrix.os }} ${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
49+
# restore-keys: npm-cache-${{ matrix.os }} ${{ matrix.node }}-
50+
- run: npm ci
51+
52+
# # install version to test against
53+
# - name: Use Node.js ${{ matrix.node }}
54+
# uses: actions/setup-node@v1
55+
# with:
56+
# node-version: ${{ matrix.node }}
57+
58+
# Run tests
59+
- run: npm test
60+
61+
# test:
62+
# needs: build
63+
# name: "Test: ${{ matrix.os }}, node ${{ matrix.node }}"
64+
# runs-on: ${{ matrix.os }}-latest
65+
# strategy:
66+
# fail-fast: false
67+
# matrix:
68+
# os: [ubuntu, windows]
69+
# node:
70+
# - 16
71+
# - 14
72+
# - 12
73+
# - 10
74+
# - 9
75+
# - '8'
76+
# - '7'
77+
# - '6'
78+
# - '4'
79+
# - '0.12'
80+
# - '0.10'
81+
# steps:
82+
# # checkout code
83+
# - uses: actions/checkout@v2
84+
# # install node
85+
# - name: Use Node.js ${{ matrix.node }}
86+
# uses: actions/setup-node@v1
87+
# with:
88+
# node-version: ${{ matrix.node }}
89+
# # lint, build, test
90+
# # Downgrade from npm 7 to 6 because 7 still seems buggy to me
91+
# - if: ${{ matrix.downgradeNpm }}
92+
# run: npm install -g npm@6
93+
# - run: |
94+
# npm config set cache "$( node -p "process.cwd()" )/temp/npm-cache"
95+
# - name: Cache dependencies
96+
# uses: actions/cache@v2
97+
# with:
98+
# path: temp/npm-cache
99+
# key: npm-cache-${{ matrix.os }}-${{ hashFiles('package-lock.json') }}
100+
# restore-keys: npm-cache-${{matrix.os }}-
101+
# - run: npm ci --ignore-scripts
102+
# - name: Upload npm logs
103+
# if: ${{ failure() }}
104+
# uses: actions/upload-artifact@v1
105+
# with:
106+
# name: npm-logs
107+
# path: temp/npm-cache/_logs
108+
# - run: npm run build-tsc
109+
# - name: Download package artifact
110+
# uses: actions/download-artifact@v1
111+
# with:
112+
# name: ts-node-packed.tgz
113+
# path: tests/
114+
# - run: npm install typescript@${{ matrix.typescript }} --force
115+
# - run: npm run test-cov
116+
# - name: Upload npm logs
117+
# if: ${{ failure() }}
118+
# uses: actions/upload-artifact@v1
119+
# with:
120+
# name: npm-logs-${{ matrix.os }}-node-${{ matrix.nodeFlag }}-typescript-${{ matrix.typescriptFlag }}
121+
# path: temp/npm-cache/_logs
122+
# - run: npm run coverage-report
123+
# if: ${{ always() }}
124+
# - name: Codecov
125+
# if: ${{ always() }}
126+
# uses: codecov/codecov-action@v1
127+
# with:
128+
# flags: ${{ matrix.os }},node_${{ matrix.nodeFlag }},typescript_${{ matrix.typescriptFlag }}

0 commit comments

Comments
 (0)