Merge remote-tracking branch 'upstream/devel' into devel+classic #398
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
name: Coverage | |
on: | |
push: | |
branches: | |
- 'devel\+classic' | |
jobs: | |
coverage: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- 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/revitteth/ee38e9beb22353eef6b88f2ad6ed7aa9 | |
file: badge.svg |