mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 04:03:49 +00:00
8f7ce51e11
* feat(hive): add a few more exclusions * fix(ci): coverage badge fix
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
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/revitteth/ee38e9beb22353eef6b88f2ad6ed7aa9
|
|
file: badge.svg |