From d97d31ff9b112493b7a6bab6afea0d297432f361 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sat, 7 May 2022 14:38:00 +0200 Subject: [PATCH 1/2] Create codecov.yml --- codecov.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..7c6df36 --- /dev/null +++ b/codecov.yml @@ -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 From 0f9acdd229424455576f3303d2ec3858dacd526e Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sat, 7 May 2022 14:40:23 +0200 Subject: [PATCH 2/2] Create codecov.yml --- .github/workflows/codecov.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..227a752 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -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