go-mail/.github/workflows/codecov.yml
2022-03-15 21:42:00 +01:00

38 lines
877 B
YAML

name: Codecov workflow
on:
push:
branches:
- main
paths:
- '**.go'
- 'go.*'
- '.github/**'
- 'codecov.yml'
pull_request:
branches:
- main
paths:
- '**.go'
- 'go.*'
- '.github/**'
- 'codecov.yml'
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: [1.14, 1.15, 1.16, 1.17]
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Run Tests
run: |
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
- name: Upload coverage to Codecov
if: success() && matrix.go == 1.17 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos