Skip to content

chore: run tests with race condition checks and atomic coverage mode #303

chore: run tests with race condition checks and atomic coverage mode

chore: run tests with race condition checks and atomic coverage mode #303

Workflow file for this run

name: "Test"
on:
push:
branches:
- main
- v2
paths-ignore:
- '.run/**'
- 'docs/**'
- 'deployments/**'
- 'scripts/**'
- '*.md'
pull_request:
branches:
- main
- v2
types: [ opened, synchronize ]
paths-ignore:
- '.run/**'
- 'docs/**'
- 'deployments/**'
- 'scripts/**'
- '*.md'
jobs:
tests:
name: "Run tests"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker BuildX
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: go-build-cache
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
- name: inject go-build-cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"go-build-cache": "/root/.cache/go-build"
}
- name: Run tests
run: |
docker compose -f ./deployments/docker/docker-compose.test.yaml up --abort-on-container-failure
- name: Archive code coverage results
uses: actions/upload-artifact@v5
with:
name: code-coverage
path: tests/unit_coverage.out
- name: Archive code coverage results
uses: actions/upload-artifact@v5
with:
name: integration-coverage
path: tests/integration_coverage.out
code_coverage:
name: "Code coverage report"
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
runs-on: ubuntu-latest
needs: tests
continue-on-error: true # not critical
permissions:
contents: read
actions: read
pull-requests: write # write permission needed to comment on PR
steps:
- uses: fgrosse/[email protected]
with:
coverage-artifact-name: code-coverage
coverage-file-name: unit_coverage.out