Skip to content

run mysql as container service in gh action #17

run mysql as container service in gh action

run mysql as container service in gh action #17

Workflow file for this run

name: Build and test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
BuildAndTestLibrary:
runs-on: ubuntu-20.04
services:
mysql:
image: mysql
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: "root"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.0
- name: Formatting check
run: ./gofmt_check.sh
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: --timeout 5m0s
- name: Build
run: go build
- name: Test
run: |
mysql -u root -p root < database/docker/db_init/flare_ftso_indexer.sql
go test -v ./indexer