Bump github.com/onsi/ginkgo/v2 from 2.25.1 to 2.25.2 #633
This file contains hidden or 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: Unit Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
cache-dependency-path: go.sum | |
go-version-file: go.mod | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt-get install -y rootlesskit | |
- name: Run tests | |
env: | |
COV_THRESHOLD: "70" | |
run: | | |
# Execute the Unit tests | |
make VERBOSE=true unit-tests | |
# Remove mock files from coverage analysis | |
sed -n -i '/\/mock\//!p' coverprofile.out | |
coverage=$(go tool cover -func=coverprofile.out | grep total | grep -Eo "[0-9]+\.[0-9]+") | |
if (( $(echo "${coverage} ${COV_THRESHOLD}" | awk '{print ($1 > $2)}') )); then | |
echo "Total Coverage is: ${coverage}%" | |
else | |
echo "Current test coverage (${coverage}%) is below the threshold (${COV_THRESHOLD}%)." | |
echo "Failed" | |
exit 1 | |
fi |