mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Go Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- patch-*
|
|
pull_request:
|
|
paths:
|
|
- '**.go'
|
|
|
|
jobs:
|
|
test-go:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
go-version: ['^1.17.0']
|
|
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: 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
|