Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions .github/workflows/publish-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
services:
docker:
image: docker:dind
options: >-
--privileged
--health-cmd="docker ps"
--health-interval=10s
--health-timeout=5s
--health-retries=5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
rabbitmq:
image: rabbitmq:3.13-management
ports:
- 5672:5672
- 15672:15672
options: >-
--health-cmd="rabbitmq-diagnostics -q ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -24,10 +45,22 @@ jobs:
- name: Install dependencies
run: go mod download

- name: Run tests
run: go test -coverprofile=coverage.txt ./...
- name: Run unit tests with coverage
run: go test -coverprofile=coverage-unit.txt -covermode=atomic ./...

- name: Run integration tests with coverage
env:
DOCKER_HOST: unix:///var/run/docker.sock
run: go test -tags=integration -coverprofile=coverage-integration.txt -covermode=atomic ./...

- name: Merge coverage reports
run: |
go install github.com/wadey/gocovmerge@latest
gocovmerge coverage-unit.txt coverage-integration.txt > coverage.txt

- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
fail_ci_if_error: true
Loading