Skip to content

chore(deps): update actions/checkout action to v7 #159

chore(deps): update actions/checkout action to v7

chore(deps): update actions/checkout action to v7 #159

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
test_and_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up mise
uses: jdx/mise-action@v3
- name: Cache Go Modules
uses: actions/cache@v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests with coverage
run: |
go test -race -coverprofile=coverage.txt -covermode=atomic $(go list ./... | grep -v internal/testhelper)
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Check if coverage is above threshold
run: |
COVERAGE=$(go tool cover -func=coverage.txt | grep total | awk '{print $3}' | sed 's/%//')
if (( $(echo "$COVERAGE < 70" | bc -l) )); then
echo "Code coverage is below 70%: $COVERAGE%"
exit 1
fi
echo "Code coverage is $COVERAGE%"