2021-06-03 12:35:31 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
2021-06-03 11:39:19 +02:00
|
|
|
name: Test
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
go-version: [1.16.x]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Test
|
2021-07-19 15:02:11 +02:00
|
|
|
run: GOBIN=$(which go) && sudo --preserve-env=GOROOT $GOBIN test -p 1 ./...
|
2021-06-15 00:00:55 +02:00
|
|
|
|
|
|
|
test_build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-06-15 00:13:52 +02:00
|
|
|
os: [ windows, linux, darwin ]
|
2021-06-15 00:00:55 +02:00
|
|
|
go-version: [1.16.x]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
|
|
|
|
- name: Cache Go modules
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: Install modules
|
|
|
|
run: go mod tidy
|
|
|
|
|
|
|
|
- name: run build
|
2021-06-15 00:08:54 +02:00
|
|
|
run: GOOS=${{ matrix.os }} go build .
|