fix upload coverage #237
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- 'deploy/**' | |
- 'examples/**' | |
- '*.md' | |
jobs: | |
test: | |
name: Lint and Test | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
contents: read | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go Environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.24' | |
cache: true | |
cache-dependency-path: go.sum | |
- name: Run Lint and Test Coverage | |
shell: bash | |
run: | | |
make lint | |
make test-coverage | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: ".cover/tests.xml" | |
commit: ${{ github.sha }} | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
files: ".cover/coverage.xml" | |
token: ${{ secrets.CODECOV_TOKEN }} | |
integration: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: network=host | |
- name: Build and Export Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: SKIP_TESTS=true | |
file: docker/Dockerfile | |
context: . | |
tags: pumba:test | |
target: integration-tests | |
outputs: type=docker,dest=/tmp/image.tar | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run Integration Tests | |
run: | | |
docker load -i /tmp/image.tar | |
docker run -i --rm --name integration-tests -v /var/run/docker.sock:/var/run/docker.sock pumba:test |