committed by
GitHub
parent
cfc6ecac41
commit
3426f8bd2d
47
.github/workflows/ci.yml
vendored
Normal file
47
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
on: [push, pull_request]
|
||||
|
||||
name: ci
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.13.x]
|
||||
platform: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Configure Go Environment
|
||||
run: |
|
||||
echo ::set-env name=GOPATH::${{ runner.workspace }}
|
||||
echo ::add-path::${{ runner.workspace }}/bin
|
||||
- name: Go Environment
|
||||
run: go env
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
- name: Bootstrap
|
||||
run: ./script/bootstrap
|
||||
|
||||
- name: Build
|
||||
run: go build ./...
|
||||
- name: Test
|
||||
run: go test -bench . ./...
|
||||
- name: Coverage
|
||||
run: ./script/coverage
|
||||
- name: Lint
|
||||
run: ./script/lint
|
||||
|
||||
- name: Upload Unit Test Coverage
|
||||
uses: codecov/codecov-action@v1.0.5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: unittests.coverprofile
|
||||
flags: unittests
|
||||
- name: Upload Integration Test Coverage
|
||||
uses: codecov/codecov-action@v1.0.5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: integration.coverprofile
|
||||
flags: integration
|
||||
@@ -4,7 +4,7 @@ main=$1
|
||||
coverprofile=$2
|
||||
|
||||
# Temporary working directory.
|
||||
workdir=$(mktemp -d)
|
||||
workdir=$(mktemp -d tmpXXXXXXXX)
|
||||
|
||||
# Wrap the main function in a go test.
|
||||
cp ${main} ${workdir}
|
||||
|
||||
Reference in New Issue
Block a user