All checks were successful
Generate check / check-changes (push) Successful in 4s
Generate check / check-changes (pull_request) Successful in 3s
Quality / check-changes (pull_request) Successful in 3s
Generate check / check-generate (push) Has been skipped
Generate check / check-generate (pull_request) Has been skipped
Quality / tests (pull_request) Successful in 16s
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Quality
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
|
|
jobs:
|
|
check-changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
has_go_changes: ${{ steps.check.outputs.has_go_changes }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check for Go changes
|
|
id: check
|
|
run: |
|
|
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.go$|go\.(mod|sum)$'; then
|
|
echo "has_go_changes=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "has_go_changes=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
needs: check-changes
|
|
if: needs.check-changes.outputs.has_go_changes == 'true'
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: 1.25
|
|
|
|
- name: Run Unit tests
|
|
run: |
|
|
go test -race -covermode atomic -coverprofile=coverage.out ./...
|
|
grep -v "_gen.go" coverage.out > coverage.filtered.out
|
|
mv coverage.filtered.out coverage.out
|
|
|
|
- name: Install goveralls
|
|
run: go install github.com/mattn/goveralls@v0.0.12
|
|
|
|
- name: Send coverage
|
|
env:
|
|
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN}}
|
|
run: goveralls -coverprofile=coverage.out -service=github
|