Merge pull request 'update coveralls badge when main is updated' (#20) from update-coveralls-badge into main
All checks were successful
Badges / coveralls (push) Successful in 25s
All checks were successful
Badges / coveralls (push) Successful in 25s
Reviewed-on: #20
This commit was merged in pull request #20.
This commit is contained in:
32
.gitea/workflows/badges.yml
Normal file
32
.gitea/workflows/badges.yml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Badges
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
coveralls:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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 with coverage
|
||||||
|
run: |
|
||||||
|
go test -covermode atomic -coverprofile=coverage.out ./...
|
||||||
|
grep -v -E "(main|_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
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
name: Generate check
|
name: Generate check
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-changes:
|
check-changes:
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
echo "has_gen_changes=false" >> $GITHUB_OUTPUT
|
echo "has_gen_changes=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check-generate:
|
verify-generate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check-changes
|
needs: check-changes
|
||||||
if: needs.check-changes.outputs.has_gen_changes == 'true'
|
if: needs.check-changes.outputs.has_gen_changes == 'true'
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
echo "has_go_changes=false" >> $GITHUB_OUTPUT
|
echo "has_go_changes=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tests:
|
run-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check-changes
|
needs: check-changes
|
||||||
if: needs.check-changes.outputs.has_go_changes == 'true'
|
if: needs.check-changes.outputs.has_go_changes == 'true'
|
||||||
@@ -40,13 +40,3 @@ jobs:
|
|||||||
- name: Run Unit tests
|
- name: Run Unit tests
|
||||||
run: |
|
run: |
|
||||||
go test -race -covermode atomic -coverprofile=coverage.out ./...
|
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user