Skip to content

fixed coverage analysis #143

fixed coverage analysis

fixed coverage analysis #143

Workflow file for this run

name: test
on:
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go:
- '^1.20'
- '^1.21'
- '^1.22'
- '^1.23'
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: vet
run: go vet ./...
- name: Declare some variables
id: vars
run: |
echo "coverage_txt=${RUNNER_TEMP}/coverage.txt" >> "$GITHUB_OUTPUT"
- name: Test Coverage (pkg)
run: |
go test ./... -race -coverprofile=${{ steps.vars.outputs.coverage_txt }}.tmp
cat ${{ steps.vars.outputs.coverage_txt }}.tmp | grep -v synchro/tz | grep -v synchro/scripts > ${{ steps.vars.outputs.coverage_txt }}
go tool cover -func ${{ steps.vars.outputs.coverage_txt }}
- name: Upload coverage
if: ${{ matrix.go == '^1.23' }}
uses: codecov/codecov-action@v5
with:
files: ${{ steps.vars.outputs.coverage_txt }}
gcov_ignore: tz