diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 170e448..fafcfa2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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