diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e52964a..cf2b5cf 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,33 +1,50 @@ name: Go -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push, pull_request] jobs: - build: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + go-version: [1.14.x, 1.15.x] + runs-on: ${{ matrix.os }} services: redis: image: redis ports: - 6379:6379 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.15 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} - - name: Build - run: go build -v ./... + - name: Build + run: go build -v ./... - - name: Test - run: go test -race -v ./... + - name: Test + run: go test -race -v -coverprofile=coverage.txt -covermode=atomic ./... - - name: Bench Test - run: go test -run=^$ -bench=. -loglevel=debug ./... + - name: Upload Test Results + uses: actions/upload-artifact@v2 + with: + name: test-results + path: test-results.txt + + - name: Upload Coverage + uses: actions/upload-artifact@v2 + with: + name: coverage + path: coverage.txt + + - name: Benchmark Test + run: go test -run=^$ -bench=. ./... | tee -a bench.txt + + - name: Upload Benchmark + uses: actions/upload-artifact@v2 + with: + name: bench-${{ matrix.os }}-${{ matrix.go-version }} + path: bench.txt