forked from namsral/flag
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
20 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 |
---|---|---|
@@ -1,31 +1,35 @@ | ||
name: main | ||
name: Tests and Coverage | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
test: | ||
name: Test and Build | ||
strategy: | ||
matrix: | ||
go-version: [1.14.x, 1.15.x] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
- name: Code checkout | ||
uses: actions/checkout@v1 | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Test | ||
run: | | ||
go test -v ./... -coverprofile=coverage.txt -covermode=atomic | ||
go test -v ./... -race | ||
run: go test -v ./... -race | ||
- name: Build | ||
run: | | ||
GOOS=linux go build | ||
GOOS=darwin go build | ||
GOOS=freebsd go build | ||
GOOS=windows go build | ||
GOARCH=386 go build | ||
run: go build | ||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Generage coverage | ||
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic | ||
- name: Publish coverage | ||
uses: codecov/codecov-action@v1.0.6 | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.txt |