ci: Show coverage for all packages
Some checks failed
Lint / lint (pull_request) Has been cancelled
Lint / lint (push) Has been cancelled
Test / test (1.20.x, ubuntu-latest) (pull_request) Has been cancelled
Test / test (1.21.x, ubuntu-latest) (pull_request) Has been cancelled
Test / test (1.20.x, ubuntu-latest) (push) Has been cancelled
Test / test (1.21.x, ubuntu-latest) (push) Has been cancelled

We have test utils in other packages that are not shown as tested, while
they definitely are.
This commit is contained in:
Marco Trevisan (Treviño)
2023-12-01 23:41:06 +01:00
parent 04578a00b0
commit 6c585aed74

View File

@@ -27,18 +27,18 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Test - name: Test
run: sudo go test -v -cover -coverprofile=coverage.out ./... run: sudo go test -v -cover -coverprofile=coverage.out -coverpkg=./... ./...
- name: Test with Address Sanitizer - name: Test with Address Sanitizer
env: env:
GO_PAM_TEST_WITH_ASAN: true GO_PAM_TEST_WITH_ASAN: true
CGO_CFLAGS: "-O0 -g3 -fno-omit-frame-pointer" CGO_CFLAGS: "-O0 -g3 -fno-omit-frame-pointer"
run: | run: |
# Do not run sudo-requiring go tests because as PAM has some leaks in 22.04 # Do not run sudo-requiring go tests because as PAM has some leaks in 22.04
go test -v -asan -cover -coverprofile=coverage-asan-tx.out -gcflags=all="-N -l" go test -v -asan -cover -coverprofile=coverage-asan-tx.out -coverpkg=./... -gcflags=all="-N -l"
# Run the rest of tests normally # Run the rest of tests normally
sudo go test -v -cover -coverprofile=coverage-asan-module.out -asan -gcflags=all="-N -l" -run Module sudo go test -v -cover -coverprofile=coverage-asan-module.out -coverpkg=./... -asan -gcflags=all="-N -l" -run Module
sudo go test -C cmd -coverprofile=coverage-asan.out -v -asan -gcflags=all="-N -l" ./... sudo go test -C cmd -coverprofile=coverage-asan.out -v -coverpkg=./... -asan -gcflags=all="-N -l" ./...
- name: Generate example module - name: Generate example module
run: | run: |
rm -f example-module/pam_go.so rm -f example-module/pam_go.so