fleet/.github/workflows/test-go.yaml

55 lines
1.3 KiB
YAML
Raw Normal View History

name: Go Tests
on:
push:
branches:
- main
2021-10-18 21:49:32 +00:00
- patch-*
paths:
- '**.go'
pull_request:
paths:
- '**.go'
workflow_dispatch: # Manual
jobs:
test-go:
strategy:
matrix:
os: [ubuntu-latest]
2021-11-05 02:50:00 +00:00
go-version: ['^1.17.0']
mysql: ["mysql:5.7", "mysql:8"]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
uses: actions/checkout@v2
# Pre-starting dependencies here means they are ready to go when we need them.
- name: Start Infra Dependencies
# Use & to background this
run: FLEET_MYSQL_IMAGE=${{ matrix.mysql }} docker-compose up -d mysql_test redis redis-cluster-1 redis-cluster-2 redis-cluster-3 redis-cluster-4 redis-cluster-5 redis-cluster-6 redis-cluster-setup &
# It seems faster not to cache Go dependencies
- name: Install Go Dependencies
run: make deps-go
- name: Generate static files
run: |
export PATH=$PATH:~/go/bin
make generate-go
- name: Run Go Tests
run: |
NETWORK_TEST=1 REDIS_TEST=1 MYSQL_TEST=1 make test-go
- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
files: coverage.txt