Created a deletion endpoint for accounts #23
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
# example 2: on merge to master from pull request (recommended) | |
name: Check test coverage | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go 1.23.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23.0" | |
- name: Install dependencies | |
run: go install | |
- name: Install bc | |
run: sudo apt-get install -y bc | |
- name: Check code coverage | |
run: | | |
echo "Checking that code coverage is above 80% within the internal package..." | |
go test ./internal/... -coverprofile=coverage.out | |
total_coverage=$(go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+') | |
echo "Total coverage: $total_coverage" | |
if (( $(echo "$total_coverage > 80.0" | bc -l) )); then | |
echo "Code coverage is above 80%!" | |
else | |
echo "Code coverage is below 80%!" | |
exit 1 | |
fi |