-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/Add-File-Cache
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 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 |
---|---|---|
|
@@ -15,6 +15,7 @@ on: | |
|
||
jobs: | ||
docker: | ||
name: Publish Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
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 |
---|---|---|
|
@@ -14,7 +14,8 @@ on: | |
- "src/**" | ||
|
||
jobs: | ||
run-converter-tests: | ||
run-tests: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
@@ -29,7 +30,7 @@ jobs: | |
|
||
- run: npm run test | ||
|
||
- name: Convert code coverage results | ||
- name: Convert code coverage results for summary | ||
uses: irongut/[email protected] | ||
with: | ||
filename: coverage/*.xml | ||
|
@@ -46,3 +47,39 @@ jobs: | |
|
||
- name: Write to job summary | ||
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Convert code coverage results for badge | ||
uses: irongut/[email protected] | ||
if: github.event_name != 'pull_request' | ||
with: | ||
filename: coverage/*.xml | ||
hide_branch_rate: true | ||
hide_complexity: true | ||
badge: true | ||
output: 'file' | ||
|
||
- name: Extract code coverage badge | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
read -r line < code-coverage-results.txt | ||
coverage=$(echo "$line" | sed -n 's/.*Code%20Coverage-\([0-9]*\)%.*/\1/p') | ||
condition=$(echo "$line" | sed -n 's/.*%25-\([a-z]*\)?.*/\1/p') | ||
[[ $condition == "critical" ]] && color="#e05d44" || color="#44cc11" | ||
cat <<EOF > cov.json | ||
{ | ||
"schemaVersion": 1, | ||
"label": "Code Coverage", | ||
"message": "$coverage", | ||
"style": "for-the-badge", | ||
"color": "$color" | ||
} | ||
- name: Publish code coverage badge | ||
uses: exuanbo/actions-deploy-gist@v1 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
token: ${{ secrets.GIST_SECRET }} | ||
gist_id: dd5dc24ffa62de59b3d836f856f48a10 | ||
file_path: cov.json |
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