[us40] Automatic categorization #124
This file contains 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: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
run: npm run test:headless | |
- name: Cache stryker incremental file | |
uses: actions/cache@v3 | |
with: | |
key: stryker-cache | |
path: ./reports/stryker-incremental.json | |
- name: Run stryker run | |
run: npm run test:mutation | |
env: | |
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: stryker-report | |
path: reports/mutation | |
retention-days: 30 | |
- name: Convert mutation issues to sonarcloud generic issues | |
run: jq -f stryker-tool/mutation-report-to-sonar.jq reports/mutation/mutation.json > mutation-sonar.json | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |