Merge pull request #1606 from bbc/fix/SOFIE-290 #5598
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
| on: | |
| # Trigger analysis when pushing in main or pull requests, and when creating | |
| # a pull request. | |
| push: | |
| branches: | |
| - main | |
| - release** | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| name: SonarCloud analysis | |
| jobs: | |
| sonarqube: | |
| name: SonarQube | |
| runs-on: ubuntu-latest | |
| if: ${{ github.repository_owner == 'Sofie-Automation' && !github.event.pull_request.head.repo.fork }} | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # Disabling shallow clone is recommended for improving relevancy of reporting | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ".node-version" | |
| - uses: ./.github/actions/setup-meteor | |
| - name: restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| meteor/node_modules | |
| packages/node_modules | |
| key: ${{ runner.os }}-${{ hashFiles('yarn.lock', 'meteor/yarn.lock', 'meteor/.meteor/release', 'packages/yarn.lock') }} | |
| - name: Prepare Environment | |
| run: | | |
| corepack enable | |
| yarn config set cacheFolder /home/runner/lint-core-cache | |
| yarn | |
| # setup zodern:types. No linters are setup, so this simply installs the packages | |
| yarn meteor lint | |
| yarn build:packages | |
| env: | |
| CI: true | |
| - name: SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@v6 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |