7 types: [opened, synchronize, reopened]
19 os: [windows-latest, macos-latest, ubuntu-latest]
20 node: ['16.x', '18.x', '20.x']
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@v2
37 - name: Setup Node.js ${{ matrix.node }}
38 uses: actions/setup-node@v3
40 node-version: ${{ matrix.node }}
43 - name: Install Dependencies
44 run: pnpm install --ignore-scripts
50 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
56 - name: Coverage Report
57 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
60 - name: Check for SonarCloud Token Availability
64 if [ "${{ secrets.SONAR_TOKEN }}" != '' ]; then
65 echo "available=true" >> $GITHUB_OUTPUT;
67 echo "available=false" >> $GITHUB_OUTPUT;
70 - name: SonarCloud Code Analysis
71 if: ${{ steps.sonar-token.outputs.available == 'true' && github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
72 uses: sonarsource/sonarcloud-github-action@v2.0.2
74 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}