chore(deps): update jdx/mise-action digest to c2a8761 #193
Workflow file for this run
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: 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up mise | |
| uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4 | |
| - name: Cache Go Modules | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| 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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # 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%" |