forked from erigontech/erigon
-
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.
feat(ci): badges for hive and code coverage on devel (erigontech#4793)
* feat(ci): badges for hive and code coverage on devel * feat(ci): hive CI tidy up (#2) run hive on successful CI only run on non-draft PR only
- Loading branch information
Showing
5 changed files
with
136 additions
and
40 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Coverage | ||
on: | ||
push: | ||
branches: | ||
- devel | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: git submodule update --init --recursive --force | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18.x | ||
|
||
- name: install dependencies on Linux | ||
if: runner.os == 'Linux' | ||
run: sudo apt update && sudo apt install build-essential | ||
|
||
- name: run coverage | ||
run: echo "COVERAGE=$(make coverage)" >> $GITHUB_ENV | ||
|
||
- name: set badge color | ||
shell: bash | ||
run: | | ||
if [ ${{ env.COVERAGE }} -lt 40 ] | ||
then | ||
echo "BADGE_COLOR=800000" >> $GITHUB_ENV | ||
elif [ ${{ env.COVERAGE }} -lt 75 ] | ||
then | ||
echo "BADGE_COLOR=696969" >> $GITHUB_ENV | ||
else | ||
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV | ||
fi | ||
- name: create badge | ||
uses: emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1 | ||
with: | ||
label: Coverage | ||
status: ${{ env.COVERAGE }} | ||
color: ${{ env.BADGE_COLOR }} | ||
path: badge.svg | ||
|
||
- name: upload badge to gist | ||
if: > | ||
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'devel' || | ||
github.event_name != 'workflow_run' && github.ref == 'refs/heads/devel' | ||
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d | ||
with: | ||
token: ${{ secrets.GIST_TOKEN }} | ||
gistURL: https://gist.githubusercontent.com/revittm/ee38e9beb22353eef6b88f2ad6ed7aa9 | ||
file: badge.svg |
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 was deleted.
Oops, something went wrong.
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