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

https://github.com/gotesttools/limgo-action

GitHub Action for limgo
https://github.com/gotesttools/limgo-action

github-actions go golang test-coverage testing

Last synced: 27 days ago
JSON representation

GitHub Action for limgo

Awesome Lists containing this project

README

          


limgo-action

Don't let your test coverage drop



GitHub release
unlicense

---

This action uses [limgo](https://github.com/GoTestTools/limgo) to enforce test coverage thresholds.

## Usage

You can use `limgo-action` with the following configuration:

```yaml
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
# Checkout your project with git
- name: Checkout
uses: actions/checkout@v2

# Install Go on the VM running the action.
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19

# Run your tests with -coverprofile
- name: Run tests
run: |
go test ./... -coverprofile=test.cov

# Option 1:
# Run the test coverage check using the limgo-action
- name: Run test coverage check
uses: GoTestTools/limgo-action@v1.0.0
with:
version: "v0.0.0-beta"
args: "-coverfile=test.cov -outfile=covcheck.tmp -config=.limgo.json -v=3"

# Option 2:
# Only install limgo and use it later
- name: Run test coverage check
uses: GoTestTools/limgo-action@v1.0.0
with:
version: "v0.0.0-beta"
install-only: true

# Optional:
# Upload the coverage check results as artifact
- name: Upload test coverage results
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-coverage-results
path: covcheck.tmp
if-no-files-found: error
```

For more information about `limgo` please see the [limgo](https://github.com/GoTestTools/limgo) repository.