Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/k1low/octocov-action

:octocat: GitHub Action for octocov
https://github.com/k1low/octocov-action

badge code-coverage code-metrics code-to-test-ratio coverage-report github-actions test-execution-time testing

Last synced: 8 days ago
JSON representation

:octocat: GitHub Action for octocov

Awesome Lists containing this project

README

        

# octocov-action

:octocat: GitHub Action for [octocov](https://github.com/k1LoW/octocov)

![comment](docs/comment_with_diff.png)

## Usage

Add `.octocov.yml` ( or `octocov.yml` ) file to your repository.

( `octocov init` is useful for easy generation. )

``` yaml
# .octocov.yml Go example
coverage:
paths:
- path/to/coverage.out
codeToTestRatio:
code:
- '**/*.go'
- '!**/*_test.go'
test:
- '**/*_test.go'
testExecutionTime:
if: true
diff:
datastores:
- artifact://${GITHUB_REPOSITORY}
comment:
if: is_pull_request
report:
if: is_default_branch
datastores:
- artifact://${GITHUB_REPOSITORY}
```

And set up a workflow file as follows and run octocov on GitHub Actions.

``` yaml
# .github/workflows/ci.yml
name: Test

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
-
uses: actions/setup-go@v4
with:
go-version-file: go.mod
-
name: Run tests with coverage report output
run: go test ./... -coverprofile=coverage.out
-
uses: k1LoW/octocov-action@v1
```

See [action.yml](action.yml) and [octocov README](https://github.com/k1LoW/octocov) for more details on how to configure it.

## [Docker container action](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action) version

Use `v0`.