7 types: [opened, synchronize, reopened]
19 os: [windows-latest, macos-latest, ubuntu-latest]
20 node: ['18.x', '20.x', 'latest']
22 name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
24 runs-on: ${{ matrix.os }}
28 uses: actions/checkout@v4
30 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis. This is needed for better sonar
33 uses: pnpm/action-setup@v4
35 - name: Setup Node.js ${{ matrix.node }}
36 uses: actions/setup-node@v4
38 node-version: ${{ matrix.node }}
41 - name: Install Dependencies
42 run: pnpm install --ignore-scripts --frozen-lockfile
48 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
54 - name: Coverage Report
55 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
58 - name: Check for SonarCloud Token Availability
62 if [ "${{ secrets.SONAR_TOKEN }}" != '' ]; then
63 echo "available=true" >> $GITHUB_OUTPUT;
65 echo "available=false" >> $GITHUB_OUTPUT;
68 - name: SonarCloud Code Analysis
69 if: ${{ steps.sonar-token.outputs.available == 'true' && github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
70 uses: sonarsource/sonarcloud-github-action@v2.2.0
72 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}