Skip to content

Commit c5e239c

Browse files
committed
setup mysql in CI
1 parent e4da5f8 commit c5e239c

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
1-
name: CI
21

2+
name: CI
33
on: [pull_request]
4-
54
jobs:
65
build:
7-
86
runs-on: ubuntu-latest
9-
7+
strategy:
8+
matrix:
9+
mysql_version: ["5.7", "8.0"]
10+
services:
11+
mysql:
12+
image: mysql:${{ matrix.mysql_version }}
13+
env:
14+
MYSQL_ROOT_PASSWORD: "root"
15+
MYSQL_DATABASE: "test"
16+
TZ: America/Los_Angeles
17+
ports:
18+
- "3306:3306"
19+
options: >-
20+
--health-cmd="mysqladmin ping"
21+
--health-interval=10s
22+
--health-timeout=5s
23+
--health-retries=3
1024
steps:
1125
- uses: actions/checkout@v4
12-
1326
- name: Set up Go
1427
uses: actions/setup-go@v5
1528
with:
1629
go-version-file: go.mod
17-
1830
- name: Build
1931
run: script/cibuild
20-
2132
- name: Upload gh-ost binary artifact
2233
uses: actions/upload-artifact@v4
2334
with:

script/test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
. script/bootstrap
66

77
echo "Verifying code is formatted via 'gofmt -s -w go/'"
8-
gofmt -s -w go/
8+
gofmt -s -w go/
99
git diff --exit-code --quiet
1010

1111
echo "Building"
@@ -14,4 +14,4 @@ script/build
1414
cd .gopath/src/github.com/github/gh-ost
1515

1616
echo "Running unit tests"
17-
go test -v -covermode=atomic ./go/...
17+
go test -v -p 1 -covermode=atomic ./go/...

0 commit comments

Comments
 (0)