mirror of
https://github.com/wneessen/go-hibp.git
synced 2024-12-23 02:30:38 +01:00
commit
21f15be49f
2 changed files with 58 additions and 0 deletions
40
.github/workflows/codecov.yml
vendored
Normal file
40
.github/workflows/codecov.yml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
name: Codecov workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'go.*'
|
||||
- '.github/**'
|
||||
- 'codecov.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'go.*'
|
||||
- '.github/**'
|
||||
- 'codecov.yml'
|
||||
env:
|
||||
HIBP_API_KEY: ${{ secrets.HIBP_API_KEY }}
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
go: [1.15, 1.16, 1.17, 1.18]
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
go test -v -race --coverprofile=coverage.coverprofile --covermode=atomic .
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
if: success() && matrix.go == 1.18 && matrix.os == 'ubuntu-latest'
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
18
codecov.yml
Normal file
18
codecov.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: 80%
|
||||
threshold: 5%
|
||||
base: auto
|
||||
if_ci_failed: error
|
||||
only_pulls: false
|
||||
patch:
|
||||
default:
|
||||
target: 90%
|
||||
base: auto
|
||||
if_ci_failed: error
|
||||
threshold: 5%
|
||||
|
||||
comment:
|
||||
require_changes: true
|
Loading…
Reference in a new issue