Skip to content

GoTestTools/limgo-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

limgo-action

Don't let your test coverage drop

GitHub release unlicense


This action uses limgo to enforce test coverage thresholds.

Usage

You can use limgo-action with the following configuration:

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/[email protected]
        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/[email protected]
        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 repository.