d08f4158b0f53be1a5c125fa361442bb8a7516bf
[poolifier.git] / .github / workflows / ci.yml
1 name: CI
2
3 on:
4 push:
5 branches:
6 - master
7 pull_request:
8 workflow_dispatch:
9 inputs:
10 withBenchmark:
11 description: 'With Benchmark?'
12 default: false
13
14 jobs:
15 build:
16 runs-on: ubuntu-latest
17
18 strategy:
19 matrix:
20 node-version: [12.x, 14.x]
21
22 steps:
23 - name: Checkout
24 uses: actions/checkout@v2
25
26 - name: Set node version to ${{ matrix.node-version }}
27 uses: actions/setup-node@v1
28 with:
29 node-version: ${{ matrix.node-version }}
30
31 - name: Install
32 run: npm ci
33
34 - name: Build
35 run: npm run build --if-present
36
37 - name: Lint
38 run: npm run lint
39
40 - name: Test
41 if: github.ref != 'refs/heads/master'
42 run: npm run test
43
44 - name: Test & Coverage
45 if: github.ref == 'refs/heads/master'
46 run: |
47 npm run test
48 export COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
49 npm run coverage
50 env:
51 CI: true
52
53 - name: Benchmark
54 if: github.event.inputs.withBenchmark
55 run: npm run benchmark