ci: fix qlty coverage upload

Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
Jan Larwig 2026-01-17 15:52:46 +01:00
parent cc0b48d5ec
commit 5020c33124
No known key found for this signature in database
GPG Key ID: C2172BFA220A037A
2 changed files with 19 additions and 30 deletions

View File

@ -7,6 +7,10 @@ on:
pull_request:
branches:
- '**'
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
@ -22,13 +26,17 @@ jobs:
go-version-file: go.mod
id: go
- name: Get dependencies
- name: Install golangci-lint
env:
# renovate: datasource=github-tags depName=golangci/golangci-lint
GOLANGCI_LINT_VERSION: v2.8.0
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
- name: Install gcov2lcov
run: |
go install github.com/jandelgado/gcov2lcov@latest
- name: Verify Code Generation
run: |
make verify-generate
@ -49,10 +57,17 @@ jobs:
make release
- name: Test
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
./.github/workflows/test.sh
make test
- name: Generate Coverage Report
run: |
gcov2lcov -infile=c.out -outfile=lcov.info
- uses: qltysh/qlty-action/coverage@v2
with:
oidc: true
files: lcov.info
docker:
runs-on: ubuntu-latest

View File

@ -1,26 +0,0 @@
#!/bin/bash
# manually exiting from script, because after-build needs to run always
set +e
if [ -z $CC_TEST_REPORTER_ID ]; then
echo "1. CC_TEST_REPORTER_ID is unset, skipping"
else
echo "1. Running before-build"
./cc-test-reporter before-build
fi
echo "2. Running test"
make test
TEST_STATUS=$?
if [ -z $CC_TEST_REPORTER_ID ]; then
echo "3. CC_TEST_REPORTER_ID is unset, skipping"
else
echo "3. Running after-build"
./cc-test-reporter after-build --exit-code $TEST_STATUS --prefix $(go list -m)
fi
if [ "$TEST_STATUS" -ne 0 ]; then
echo "Test failed, status code: $TEST_STATUS"
exit $TEST_STATUS
fi