Skip to content

Commit

Permalink
chore: add codacy coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
auula committed Sep 10, 2023
1 parent e2f52c4 commit ea39064
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 41 deletions.
43 changes: 32 additions & 11 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
name: Codacy Coverage Reporter
name: Codacy and Codecov Integration

on: ["push"]
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
codacy-coverage-reporter:
build-and-report:
runs-on: ubuntu-latest
name: codacy-coverage-reporter
name: Build, Test, and Report Coverage
steps:
- uses: actions/checkout@v2
- name: Run codacy-coverage-reporter
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"

- name: Build
run: go build -v ./...

- name: Test
run: ./test.sh 1

- name: Test Coverage
run: ./test.sh 4

- name: Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# or
# api-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: <coverage.out>
# or a comma-separated list for multiple reports
# coverage-reports: <PATH_TO_REPORT>, <PATH_TO_REPORT>
coverage-reports: coverage.out # Replace with the actual path to your coverage report file

- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
30 changes: 0 additions & 30 deletions .github/workflows/go.yml

This file was deleted.

0 comments on commit ea39064

Please sign in to comment.