-
-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from gorgonia/devops
feat: attempt for a github action
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
on: [pull_request] | ||
name: test and build | ||
env: | ||
GOPROXY: "https://proxy.golang.org" | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go: [1.13, 1.14] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Install Go ${{ matrix.go }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run tests | ||
run: go test -v | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Calc coverage | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
go test -v -covermode=count -coverprofile=coverage.out | ||
- name: Convert coverage to lcov | ||
uses: jandelgado/gcov2lcov-action@v1.0.0 | ||
with: | ||
infile: coverage.out | ||
outfile: coverage.lcov | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@v1.0.1 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
path-to-lcov: coverage.lcov | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
go: [1.13, 1.14] | ||
goos: [linux, darwin] | ||
goarch: [amd64, arm] | ||
exclude: | ||
# windows/386 and darwin/386 seems useless | ||
- goarch: "arm" | ||
goos: darwin | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- name: Install Go ${{ matrix.go }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: build | ||
run: go build . | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} |