Skip to content

Commit

Permalink
Implement GitHub Actions support (#145)
Browse files Browse the repository at this point in the history
* Add initital integrations for GitHub Actions

Coverage reports are just left in place so far

* Remove unnecessary go get commands

* Fix coverage report download

* Add matrix testing for multile version of Go

* Remove explicit build step from actions

* Download additional dependencies

* Ad debugging for gopath

* Add deugging for repo workspace

* Add gopath

* Fix repo clone path to match with gopath

* Fix gopath setting

* Leave only go 1.9 and 1.10 for debugging

* Dowload go modules package for older go distributions

* Properly set the gopath

* Fix gopath setting

* Remove unnecessary module downloads

* Add download for go mod package on older go versions

* Download all deps

* Add other go distributions

* Add goveralls coverage reports

* Fix typos

* Remove explicit repo names from workflow
  • Loading branch information
Morozov-5F committed Dec 26, 2020
1 parent dcd80c9 commit f15877a
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Go

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:

test:
name: Test
strategy:
matrix:
go-version: [1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: auto
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Check out code
uses: actions/checkout@v2
with:
path: src/github.com/${{ github.repository }}

- name: Get dependencies
run: |
go get github.com/mattn/goveralls
if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
go get -v ./...
- name: Test
run: go test ./...

- name: Get Coverage Report
run: |
go test -c -covermode=count -coverpkg=github.com/cweill/gotests,github.com/cweill/gotests/internal/input,github.com/cweill/gotests/internal/render,github.com/cweill/gotests/internal/goparser,github.com/cweill/gotests/internal/output,github.com/cweill/gotests/internal/models
./gotests.test -test.coverprofile coverage.cov
- name: Send Coverage Report
run: $GOPATH/bin/goveralls -coverprofile=coverage.cov -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f15877a

Please sign in to comment.