Skip to content

Merge pull request #15 from savannahghi/to-advantage-genders #26

Merge pull request #15 from savannahghi/to-advantage-genders

Merge pull request #15 from savannahghi/to-advantage-genders #26

Workflow file for this run

name: Test
on: [push]
env:
DOCKER_BUILDKIT: 1 # Enable Buildkit and let compose use it to speed up image building
COMPOSE_DOCKER_CLI_BUILD: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
golangci:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
lint_and_test:
needs: [golangci]
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 80
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install Go dependencies
run: |
go mod download
go get github.com/axw/gocov/gocov
go get github.com/ory/go-acc
go install github.com/ory/go-acc
go install github.com/axw/gocov/gocov
go get github.com/savannahghi/[email protected]
- name: Run tests
run: |
go-acc -o coverage.txt --ignore generated,cmd,graph ./... -- -timeout 60m
grep -v "generated.go" coverage.txt | grep -v "_gen.go" | grep -v "_mock.go" | grep -v "*mock.go" | grep -v "mocks.go" | grep -v "*resolver*go" | grep -v "server.go" | grep -v "*.html" > coverage.out
go tool cover -html=coverage.out -o coverage.html
gocov convert coverage.out > coverage.json
gocov report coverage.json > coverage_report.txt
tail coverage_report.txt
- name: Install goveralls
env:
GO111MODULE: off
run: go get github.com/mattn/goveralls
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.out -service=github