fix: fix benchmark:prod script
[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]
ac0fc89e
S
10
11jobs:
12 build:
ac0fc89e
S
13 strategy:
14 matrix:
5082a5a8 15 os: [windows-latest, macos-latest, ubuntu-latest]
1df0a8db 16 node: ['16.x', '18.x', '20.x']
ac0fc89e 17
45415455
JB
18 name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
19
20 runs-on: ${{ matrix.os }}
21
ac0fc89e
S
22 steps:
23 - name: Checkout
b358d1ac 24 uses: actions/checkout@v4
515e5da7
APA
25 with:
26 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis. This is needed for better sonar
ac0fc89e 27
4c156521
JB
28 - name: Setup pnpm
29 uses: pnpm/action-setup@v2
30 with:
31 version: 8
32
8ea47589 33 - name: Setup Node.js ${{ matrix.node }}
5080f39d 34 uses: actions/setup-node@v3
ac0fc89e 35 with:
5080f39d 36 node-version: ${{ matrix.node }}
4c156521 37 cache: 'pnpm'
ac0fc89e
S
38
39 - name: Install
45415455 40 run: pnpm install --ignore-scripts
ac0fc89e 41
a34ce9a0 42 - name: Build
4c156521 43 run: pnpm build
a34ce9a0 44
73db65c0 45 - name: Lint
7c60360a 46 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
4c156521 47 run: pnpm lint
73db65c0 48
daa307e5 49 - name: Tests
4c156521 50 run: pnpm test
daa307e5 51
c3d7c4f3 52 - name: Coverage Report
85bdfa4f 53 if: ${{ github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
4c156521 54 run: pnpm coverage
253f3064 55
515e5da7 56 - name: Sonar Code Analysis
85bdfa4f 57 if: ${{ github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
f725dbf0 58 uses: sonarsource/sonarcloud-github-action@v2.0.1
515e5da7 59 env:
02fd4f2c 60 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
515e5da7 61 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}