Skip to content

test: add diagram explaining test workflow (#4790) #9420

test: add diagram explaining test workflow (#4790)

test: add diagram explaining test workflow (#4790) #9420

name: "Test coverage"
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
permissions:
id-token: write
contents: read
env:
SUBSCRIPTION_ID: "8ecadfc9-d1a3-4ea4-b844-0d9f87e4d7c8"
RESOURCE_GROUP_NAME: "agentbaker-e2e-tests"
LOCATION: "eastus"
CLUSTER_NAME: "agentbaker-e2e-test-cluster"
AZURE_TENANT_ID: "72f988bf-86f1-41af-91ab-2d7cd011db47"
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v3
with:
go-version: '1.22'
- name: Checkout code
uses: actions/checkout@v4
- name: Run unit tests
run: go test `go list ./... | grep -v e2e` -coverprofile coverage_raw.out -covermode count
- name: Remove mocks.go lines
run: |
sed '/mocks.go/d' coverage_raw.out > coverage-no-mocks.out
- name: Remove proto lines
run: |
sed '/pb.go/d' coverage-no-mocks.out > coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: run-1
path-to-lcov: coverage.lcov
finish:
needs: [unit_tests]
if: ${{ success() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "run-1"