Skip to content

feat(main): CI

feat(main): CI #1

Workflow file for this run

name: coverage
on:
push:
branches:
- main
workflow_call:
inputs:
go_version:
required: false
type: string
default: '1.20.0'
permissions:
contents: write
pull-requests: write
jobs:
coverage:
strategy:
matrix:
include:
- module: "config"
- module: "healthcheck"
- module: "httpclient"
- module: "generate"
- module: "log"
- module: "trace"
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ inputs.go_version }}
- name: Download modules for ${{ matrix.module }}
working-directory: ${{ matrix.module }}
run: go mod download
- name: Run tests for ${{ matrix.module }}
working-directory: ${{ matrix.module }}
run: go test -v -race -failfast -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
- name: Codecov for ${{ matrix.module }}
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
flags: ${{ matrix.module }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}