diff --git a/.github/workflows/stryker.yaml b/.github/workflows/stryker.yaml index 02a3bc3..0501b8e 100644 --- a/.github/workflows/stryker.yaml +++ b/.github/workflows/stryker.yaml @@ -8,9 +8,10 @@ on: - main permissions: - contents: read + contents: write issues: write pull-requests: write + pages: write jobs: stryker-js: @@ -35,23 +36,12 @@ jobs: - name: Install dependencies run: npm install - - uses: actions/create-github-app-token@v1 - id: app-token - with: - app-id: ${{ vars.GIST_APP_ID }} - private-key: ${{ secrets.GIST_APP_KEY }} - owner: ${{ github.repository_owner }} - - name: Run StrykerJS continue-on-error: true id: stryker run: | npm run stryker > out - - name: Print output - continue-on-error: true - run: cat out - - name: Save stryker JS log if: failure() continue-on-error: true @@ -59,6 +49,10 @@ jobs: with: name: stryker.log path: stryker.log + + - name: Print output + continue-on-error: true + run: cat out - name: Extract stryker score id: extract-stryker-score @@ -68,6 +62,13 @@ jobs: awk '{split($0,a,"."); print a[1]}' fullscore > score echo "stryker-score=$(tr -s '\n' < score)" >> "$GITHUB_ENV" + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.GIST_APP_ID }} + private-key: ${{ secrets.GIST_APP_KEY }} + owner: ${{ github.repository_owner }} + - name: Create the Badge for Deploy Rate continue-on-error: true uses: Schneegans/dynamic-badges-action@v1.7.0 @@ -76,6 +77,21 @@ jobs: gistID: 9ce1ad7d8e9db99796e782b244eefa4a filename: dora-stryker.json label: Mutation Score + namedLogo: stryker + message: ${{ steps.extract-stryker-score.outputs.stryker-score }}% + minColorRange: 50 + maxColorRange: 90 + valColorRange: ${{ steps.extract-stryker-score.outputs.stryker-score }} + + - name: Create the SVG Badge for Deploy Rate + continue-on-error: true + uses: Schneegans/dynamic-badges-action@v1.7.0 + with: + auth: ${{ steps.app-token.outputs.token }} + gistID: 9ce1ad7d8e9db99796e782b244eefa4a + filename: dora-stryker.svg + label: Mutation Score + namedLogo: stryker message: ${{ steps.extract-stryker-score.outputs.stryker-score }}% minColorRange: 50 maxColorRange: 90