-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
107 additions
and
20 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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.vscode | ||
cover.out | ||
cover.txt | ||
cover.html |
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 |
---|---|---|
|
@@ -6,8 +6,10 @@ inputs: | |
default: ${{ github.repository }} | ||
branch: | ||
default: cover | ||
description: > | ||
The branch to checkout and push coverage to. | ||
description: The branch to checkout and push coverage to. | ||
token: | ||
description: The token to use for pushing to the repository. | ||
default: ${{ github.token }} | ||
outputs: | ||
random-number: | ||
description: "Random number" | ||
|
@@ -18,7 +20,9 @@ runs: | |
- name: Checkout Coverage Branch | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.repository }} | ||
path: go-cover | ||
token: ${{ inputs.token }} | ||
|
||
- name: Checkout Coverage Branch | ||
shell: bash | ||
|
@@ -33,29 +37,33 @@ runs: | |
rm .git/index | ||
git clean -fdx | ||
touch index.html | ||
git add index.html | ||
git config user.email "[email protected]" | ||
git config user.name "GHA" | ||
cp ../nord.css . | ||
git add index.html nord.css | ||
git config user.email "[email protected]" | ||
git config user.name "go-coverage-action" | ||
git commit -m "chore: initial commit" | ||
git push origin ${{ inputs.branch }} | ||
fi | ||
- name: Push Coverage | ||
shell: bash | ||
run: | | ||
export REVISION=${{ github.event.pull_request.head.sha || github.sha }} | ||
export REVISION="${{ github.event.pull_request.head.sha || github.sha }}" | ||
cd go-cover | ||
mv ../cover.html ${REVISION}.html | ||
ex -sc '%s/<style>/<style>@import url("nord.css");/' -c 'x' ${REVISION}.html | ||
git add -f ${REVISION}.html | ||
git config user.email "gha@github.com" | ||
git config user.name "GHA" | ||
git commit -m "chore: add cover for ${REVISION}" | ||
git config user.email "go-coverage-action@github.com" | ||
git config user.name "go-coverage-action" | ||
git commit -m "chore: add cover for ${REVISION}" || true | ||
git push origin ${{ inputs.branch }} | ||
- name: Post Code Coverage Comment | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ inputs.token }} | ||
script: | | ||
const script = require('${{ github.workspace }}/src/update-code-coverage-comment.js') | ||
await script({ context, github }) | ||
const script = require('${{ github.workspace }}/update-code-coverage-comment.js') | ||
const revision = '${{ github.event.pull_request.head.sha || github.sha }}' | ||
await script({ context, github }, revision) |
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
:root { | ||
--nord-deep-dark: #242931; | ||
--nord0: #2e3440; | ||
--nord0-pale: rgba(46, 52, 64, 0.3); | ||
--nord1: #3b4252; | ||
--nord1-pale: rgba(59, 66, 82, 0.3); | ||
--nord2: #434c5e; | ||
--nord2-pale: rgba(67, 76, 94, 0.3); | ||
--nord3: #4c566a; | ||
--nord3-pale: rgba(76, 86, 106, 0.3); | ||
--nord4: #d8dee9; | ||
--nord4-pale: rgba(216, 222, 232, 0.3); | ||
--nord5: #e5e9f0; | ||
--nord5-pale: rgba(229, 233, 240, 0.3); | ||
--nord6: #eceff4; | ||
--nord6-pale: rgba(236, 239, 244, 0.3); | ||
--nord7: #8fbcbb; | ||
--nord7-pale: rgba(143, 188, 187, 0.3); | ||
--nord8: #88c0d0; | ||
--nord9: #81a1c1; | ||
--nord10: #5e81ac; | ||
--nord10-pale: rgba(94, 129, 172, 0.3); | ||
--nord11: #bf616a; | ||
--nord11-pale: rgba(191, 97, 106, 0.3); | ||
--nord12: #d08770; | ||
--nord12-pale: rgba(208, 135, 112, 0.3); | ||
--nord13: #ebcb8b; | ||
--nord13-pale: rgba(235, 203, 139, 0.3); | ||
--nord14: #a3be8c; | ||
--nord14-pale: rgba(163, 190, 140, 0.3); | ||
--nord15: #b48ead; | ||
--nord15-pale: rgba(180, 140, 173, 0.3); | ||
} | ||
|
||
* { | ||
font-family: Menlo, Monaco, source-code-pro, "Ubuntu Mono", "DejaVu sans mono", Consolas, monospace, Menlo, Monaco, "Courier New", monospace; | ||
font-weight: normal !important; | ||
font-size: 14px; | ||
} | ||
|
||
body { | ||
background: var(--nord0) !important; | ||
color: var(--nord4) !important; | ||
padding: 10px; | ||
} | ||
|
||
#topbar { | ||
background: var(--nord1) !important; | ||
border-color: var(--nord3) !important; | ||
} | ||
|
||
select { | ||
background-color: var(--nord-deep-dark); | ||
color: var(--nord9); | ||
border: 1px solid var(--nord3); | ||
border-radius: 3px; | ||
padding: 2px; | ||
} | ||
|
||
.cov0 { color: var(--nord11) !important; } | ||
.cov1 { color: var(--nord13) !important; } | ||
.cov2 { color: var(--nord14) !important; } | ||
.cov3 { color: var(--nord14) !important; } | ||
.cov4 { color: var(--nord14) !important; } | ||
.cov5 { color: var(--nord14) !important; } | ||
.cov6 { color: var(--nord14) !important; } | ||
.cov7 { color: var(--nord14) !important; } | ||
.cov8 { color: var(--nord14) !important; } | ||
.cov9 { color: var(--nord14) !important; } | ||
.cov10 { color: var(--nord14) !important; } |
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