1- # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
4- name : ci
1+ name : CI
52
63on :
74 push :
118 branches :
129 - ' **'
1310
14- env :
15- CI : true
16-
1711jobs :
1812 cleanup-runs :
1913 runs-on : ubuntu-latest
2317 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2418 if : " !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
2519
26- lint :
27- name : Running ESLint
20+ lint-and-typecheck :
21+ name : Running build and lint
2822 runs-on : ubuntu-latest
23+
2924 steps :
3025 - uses : actions/checkout@v2
3126 - name : Get npm cache
@@ -45,22 +40,16 @@ jobs:
4540 - name : Run eslint
4641 run : npm run lint
4742
48- test :
43+ test-ubuntu :
4944 name : Node v${{ matrix.node-version }} on ${{ matrix.os }}
5045 strategy :
5146 fail-fast : false
5247 matrix :
5348 node-version : [10.x, 12.x, 14.x]
54- os : [ ubuntu-latest ]
49+ os : [ubuntu-latest]
5550 runs-on : ${{ matrix.os }}
5651
5752 steps :
58- - name : Set git config
59- shell : bash
60- run : |
61- git config --global core.autocrlf false
62- git config --global core.symlinks true
63- if : runner.os == 'Windows'
6453 - uses : actions/checkout@v2
6554 - name : Get npm cache
6655 id : npm-cache
@@ -79,21 +68,66 @@ jobs:
7968 run : npm ci
8069 - name : Run tests with coverage
8170 run : npm run test -- --coverage && cat ./coverage/lcov.info
71+ env :
72+ CI : true
8273 - name : Run real repo tests
8374 run : npm run test:external-repos
75+ env :
76+ CI : true
8477 - name : Coveralls parallel
8578 uses : coverallsapp/github-action@master
8679 with :
8780 github-token : ${{ secrets.github_token }}
8881 flag-name : run-${{ matrix.node-version }}
8982 parallel : true
9083
84+ test-windows :
85+ name : Node v${{ matrix.node-version }} on ${{ matrix.os }}
86+ strategy :
87+ fail-fast : false
88+ matrix :
89+ node-version : [10.x, 12.x, 14.x]
90+ os : [windows-latest]
91+ runs-on : ${{ matrix.os }}
92+
93+ steps :
94+ - name : Set git config
95+ shell : bash
96+ run : |
97+ git config --global core.autocrlf false
98+ git config --global core.symlinks true
99+ if : runner.os == 'Windows'
100+ - uses : actions/checkout@v2
101+ - name : Get npm cache
102+ id : npm-cache
103+ run : echo "::set-output name=dir::$(npm config get cacheFolder)"
104+ - uses : actions/cache@v2
105+ with :
106+ path : ${{ steps.npm-cache.outputs.dir }}
107+ key : ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package-lock.json') }}
108+ restore-keys : |
109+ ${{ runner.os }}-node-${{ matrix.node-version }}-npm-
110+ - name : Use Node.js ${{ matrix.node-version }}
111+ uses : actions/setup-node@v2.1.2
112+ with :
113+ node-version : ${{ matrix.node-version }}
114+ - name : Install and build
115+ run : npm ci
116+ - name : run unit tests
117+ run : npm run test:unit
118+ - name : run real project tests
119+ run : npm run test:external-repos
120+ env :
121+ CI : true
122+
91123 finish :
92- needs : test
124+ needs : test-ubuntu
93125 runs-on : ubuntu-latest
94126 steps :
95127 - name : Coveralls finished
96128 uses : coverallsapp/github-action@master
97129 with :
98130 github-token : ${{ secrets.github_token }}
99131 parallel-finished : true
132+ env :
133+ CI : true
0 commit comments