generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update permissions and add badge generation for Stryker mutation score
- Loading branch information
Showing
1 changed file
with
28 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,10 @@ on: | |
- main | ||
|
||
permissions: | ||
contents: read | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
pages: write | ||
|
||
jobs: | ||
stryker-js: | ||
|
@@ -35,30 +36,23 @@ 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 | ||
uses: actions/upload-artifact@v4 | ||
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/[email protected] | ||
|
@@ -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/[email protected] | ||
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 | ||
|