Commit | Line | Data |
---|---|---|
ac0fc89e S |
1 | name: CI |
2 | ||
3 | on: | |
4 | push: | |
5 | branches: | |
6 | - master | |
7 | pull_request: | |
8 | ||
9 | jobs: | |
10 | build: | |
11 | runs-on: ubuntu-latest | |
12 | ||
13 | strategy: | |
14 | matrix: | |
15 | node-version: [12.x, 14.x] | |
16 | ||
17 | steps: | |
18 | - name: Checkout | |
19 | uses: actions/checkout@v2 | |
20 | ||
21 | - name: Set node version to ${{ matrix.node-version }} | |
22 | uses: actions/setup-node@v1 | |
23 | with: | |
24 | node-version: ${{ matrix.node-version }} | |
25 | ||
26 | - name: Install | |
27 | run: npm ci | |
28 | ||
29 | - name: Build | |
30 | run: npm run build --if-present | |
31 | ||
32 | - name: Test | |
33 | if: github.ref != 'refs/heads/master' | |
34 | run: npm run test | |
35 | ||
36 | - name: Test & Coverage | |
37 | if: github.ref == 'refs/heads/master' | |
38 | run: | | |
39 | npm run test | |
40 | export COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} | |
41 | npm run coverage | |
42 | env: | |
43 | CI: true |