Bump golang.org/x/tools from 0.19.0 to 0.20.0 #78
Workflow file for this run
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: Code Coverage | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
coverage: | |
name: Check Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Get Coverage | |
run: GOEXPERIMENT=nocoverageredesign go test -coverprofile coverage.out -covermode count ./... | |
- name: Check Coverage | |
env: | |
THRESHOLD: 95 | |
run: | | |
coverage="$(go tool cover -func coverage.out |sed -r -e '/^total:/! d' -e 's|^.*\s([0-9.]+)%.*$|\1|')" | |
ok="$(echo "${coverage}" "${THRESHOLD}" |awk '{print $1 >= $2}')" | |
if [ "${ok}" -ne 1 ] ; then | |
echo 1>&2 "Code coverage does not meet threshold: ${coverage}% < ${THRESHOLD}%" | |
exit 1 | |
fi |