v1.0.3 #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI - Release Check | |
| on: | |
| pull_request: | |
| branches: [master] | |
| permissions: | |
| contents: read | |
| env: | |
| SONAR_ENABLED: 'false' # set to "true" in real repos | |
| jobs: | |
| release-check: | |
| name: CI - Release Check | |
| # Only run when PR is from develop -> master | |
| if: github.head_ref == 'develop' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (full history for Sonar) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Format (check) | |
| run: npm run format | |
| - name: Lint | |
| run: npm run lint | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Test | |
| run: npm test | |
| - name: Build | |
| run: npm run build | |
| # --- SonarQube scan + Quality Gate --- | |
| - name: SonarQube Scan | |
| if: env.SONAR_ENABLED == 'true' && (github.event.pull_request.head.repo.fork == false) | |
| uses: sonarsource/sonarqube-scan-action@v4 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
| with: | |
| args: > | |
| -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} | |
| - name: SonarQube Quality Gate | |
| if: env.SONAR_ENABLED == 'true' && (github.event.pull_request.head.repo.fork == false) | |
| uses: sonarsource/sonarqube-quality-gate-action@v1.1.0 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |