Skip to content

chore: update content README.md #238

chore: update content README.md

chore: update content README.md #238

Workflow file for this run

name: prepare-before-merge
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.18'
- name: go-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.46.2
- name: unit-test
run: go test -coverprofile=coverage.out ./...
- name: coverage
run: |
SUM_COVERAGE=$(go test ./... --cover | awk '{if ($1 != "?") print $5; else print "0.0";}' | sed 's/\%//g' | awk '{s+=$1} END {printf "%.2f\n", s}')
SUM_TEST=$(go test ./... --cover | wc -l)
COVER_AVERAGE=$(echo "$SUM_COVERAGE/$SUM_TEST" | bc -l)
echo $COVER_AVERAGE
- name: upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}