chore: v2.4.12
[poolifier.git] / .github / workflows / ci.yml
CommitLineData
ac0fc89e
S
1name: CI
2
3on:
4 push:
3273bc66 5 branches: [master]
645d9208 6 pull_request:
4efc9472 7 types: [opened, synchronize, reopened]
2a7a130c
JB
8 merge_group:
9 branches: [master]
253f3064
S
10 workflow_dispatch:
11 inputs:
12 withBenchmark:
13 description: 'With Benchmark?'
14 default: false
ac0fc89e
S
15
16jobs:
17 build:
04ac2d66 18 runs-on: ${{ matrix.os }}
ac0fc89e
S
19
20 strategy:
21 matrix:
5082a5a8 22 os: [windows-latest, macos-latest, ubuntu-latest]
1df0a8db 23 node: ['16.x', '18.x', '20.x']
ac0fc89e
S
24
25 steps:
26 - name: Checkout
5080f39d 27 uses: actions/checkout@v3
515e5da7
APA
28 with:
29 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis. This is needed for better sonar
ac0fc89e 30
4c156521
JB
31 - name: Setup pnpm
32 uses: pnpm/action-setup@v2
33 with:
34 version: 8
35
2c23bc1e 36 - name: Setup node ${{ matrix.node }}
5080f39d 37 uses: actions/setup-node@v3
ac0fc89e 38 with:
5080f39d 39 node-version: ${{ matrix.node }}
4c156521 40 cache: 'pnpm'
ac0fc89e
S
41
42 - name: Install
4c156521 43 run: pnpm install
ac0fc89e 44
a34ce9a0 45 - name: Build
4c156521 46 run: pnpm build
a34ce9a0 47
73db65c0 48 - name: Lint
4c156521 49 run: pnpm lint
73db65c0 50
daa307e5 51 - name: Tests
4c156521 52 run: pnpm test
daa307e5 53
c3d7c4f3 54 - name: Coverage Report
02234757 55 if: "github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
4c156521 56 run: pnpm coverage
253f3064 57
515e5da7 58 - name: Sonar Code Analysis
02234757 59 if: "github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
1f82641b 60 uses: sonarsource/sonarcloud-github-action@v1.9.1
515e5da7 61 env:
2ba4f142 62 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
515e5da7
APA
63 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64
253f3064
S
65 - name: Benchmark
66 if: github.event.inputs.withBenchmark
4c156521 67 run: pnpm benchmark