Skip to content

Commit

Permalink
Merge branch 'coverage-report'
Browse files Browse the repository at this point in the history
  • Loading branch information
almaslennikov committed Apr 22, 2024
2 parents 0e5bc31 + 8ec59aa commit bc6981d
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
name: Test Coverage
name: Go Test Coverage with Coveralls

on:
pull_request:
branches: [master]
on: [pull_request, push]

jobs:
coverage:
build:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.21'
go-version: '^1.21' # Set this to your Go version

- name: Run tests and collect coverage
- name: Run tests with coverage
run: |
make test-coverage
- name: Generate coverage report
- name: Generate LCOV report
run: |
go tool cover -func=network-operator.cover
go install github.com/jandelgado/gcov2lcov@latest
gcov2lcov -infile=network-operator.cover -outfile=coverage.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2.2.3
with:
token: ${{ secrets.CODECOV_TOKEN }} # Required only for private repos
file: ./network-operator.cover
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true

# - name: Post coverage comment to PR
# uses: machine-learning-apps/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# path: coverage.txt
# regex: '^total:\\s*\\(statements\\)\\s*([0-9\\.]+)%'
# message: "Code coverage on this PR is **${{ match }}%**. Please ensure this meets the project standards."
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
flag-name: run-flags-1 # Optional: Custom flag name for parallel builds

0 comments on commit bc6981d

Please sign in to comment.