Skip to content

Coveralls GitHub Action with Go integration powered by mattn/goveralls

License

Notifications You must be signed in to change notification settings

quan-to/actions-goveralls

 
 

Repository files navigation

shogo82148/actions-goveralls

test Coverage Status

Coveralls GitHub Action with Go integration powered by mattn/goveralls.

SYNOPSIS

Basic Usage

Add the following step snippet to your workflows.

- uses: actions/checkout@v2
- uses: shogo82148/actions-goveralls@v1
  with:
    path-to-profile: profile.cov

Parallel Job Example

actions-goveralls supports Parallel Builds Webhook. Here is an example of matrix builds.

on: [push, pull_request]
jobs:

  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        go: ['1.11', '1.12', '1.13', '1.14']

    steps:
      - uses: actions/setup-go@v1
        with:
          go-version: ${{ matrix.go }}
      - uses: actions/checkout@v2
      - run: go test -v -coverprofile=profile.cov ./...

      - name: Send coverage
        uses: shogo82148/actions-goveralls@v1
        with:
          path-to-profile: profile.cov
          parallel: true

  # notifies that all test jobs are finished.
  finish:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: shogo82148/actions-goveralls@v1
        with:
          parallel-finished: true

Use with Legacy GOPATH mode

If you want to use Go 1.10 or earlier, you have to set GOPATH environment value and the working directory. See https://github.com/golang/go/wiki/GOPATH for more detail.

Here is an example for testing example.com/owner/repo package.

- uses: actions/checkout@v2
  with:
    path: src/example.com/owner/repo # add this

# add this step
- name: Set up GOPATH
  run: |
    echo "::set-env name=GOPATH::${{ github.workspace }}"
    echo "::add-path::${{ github.workspace }}/bin"

- run: go test -v -coverprofile=profile.cov ./...
  working-directory: src/example.com/owner/repo # add this

- uses: shogo82148/actions-goveralls@v1
  with:
    path-to-profile: profile.cov
    working-directory: src/example.com/owner/repo # add this

About

Coveralls GitHub Action with Go integration powered by mattn/goveralls

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 49.7%
  • Shell 24.9%
  • Makefile 14.2%
  • Go 7.6%
  • JavaScript 3.6%