This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 26
53 lines (46 loc) · 1.54 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Coverage
on:
push:
branches:
- devel
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