2021-12-04 16:37:46 +00:00
|
|
|
name: Go
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2021-12-04 16:44:11 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-12-04 16:46:50 +00:00
|
|
|
redis-version:
|
|
|
|
- 6.2
|
2021-12-04 16:44:11 +00:00
|
|
|
|
2021-12-04 16:37:46 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-12-04 16:49:29 +00:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
2021-12-04 16:46:50 +00:00
|
|
|
- name: Setup redis
|
|
|
|
uses: shogo82148/actions-setup-redis@v1
|
2021-12-04 16:44:11 +00:00
|
|
|
with:
|
|
|
|
redis-version: ${{ matrix.redis-version }}
|
2021-12-04 16:46:50 +00:00
|
|
|
# auto-start: "false"
|
2021-12-04 16:44:11 +00:00
|
|
|
|
2021-12-04 16:37:46 +00:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.17
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build -v ./cmd/bbgo
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: go test -v ./pkg/...
|