Skip to content

readme: installation alert (#177) #47

readme: installation alert (#177)

readme: installation alert (#177) #47

Workflow file for this run

name: Go
on:
push:
branches: [ master ]
paths:
- '**.go'
pull_request:
paths:
- '**.go'
env:
GOPROXY: "https://proxy.golang.org"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: --timeout=30m
test:
name: Test
runs-on: ubuntu-latest
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: cardinal_passw0rd
MYSQL_DATABASE: old_test_db
ports:
- 3306:3306
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: Checkout code
uses: actions/checkout@v2
- name: Cache downloaded modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
# add `-race` to check data race
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
env:
DBPORT: 3306
DBHOST: localhost
DBUSER: root
DBPASSWORD: cardinal_passw0rd
DBNAME: old_test_db # For old database test
PGPORT: 5432
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
PGSSLMODE: disable
CARDINAL_TEST: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: ./coverage.txt
flags: unittests
fail_ci_if_error: true