Skip to content

Commit

Permalink
Add code coverage upload
Browse files Browse the repository at this point in the history
Add codecov.io code coverage upload.

Restructure GitHub Action steps.
  • Loading branch information
HeavyWombat committed Feb 8, 2021
1 parent 29e177c commit e263d27
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
---
name: Build
name: Build and Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: [push, pull_request]

jobs:
build:
name: Build
name: Build and Tests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
Expand All @@ -19,26 +15,50 @@ jobs:

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Verify Go Modules Setup
run: |
go mod verify
- name: Build
- name: Build Go Code
run: |
go build ./...
- name: Test
- name: Sanity Check (go vet)
run: |
go vet ./...
- name: Sanity Check (ineffassign)
run: |
go get github.com/gordonklaus/ineffassign
ineffassign ./...
- name: Sanity Check (golint)
run: |
go get golang.org/x/lint/golint
golint ./...
- name: Sanity Check (misspell)
run: |
go get github.com/client9/misspell/cmd/misspell
find . -type f | xargs misspell -source=text -error
- name: Sanity Check (staticcheck)
run: |
go get honnef.co/go/tools/cmd/staticcheck
staticcheck ./...
- name: Run Go Unit Tests
run: |
go get github.com/onsi/ginkgo/ginkgo github.com/onsi/gomega/...
ginkgo -r -randomizeAllSpecs -randomizeSuites -failOnPending -nodes=1 -compilers=1 -race -trace -cover
ginkgo -randomizeAllSpecs -randomizeSuites -failOnPending -nodes=1 -compilers=1 -race -trace -cover
- name: Upload Code Coverage Profile
uses: codecov/codecov-action@v1
with:
files: ./*.coverprofile
flags: unittests
fail_ci_if_error: true
verbose: false

0 comments on commit e263d27

Please sign in to comment.