Skip to content

Commit 527ce0f

Browse files
authored
migrate travis CI to GitHub Actions (#27)
* migrate travis CI to GitHub Actions * ci: use ubuntu 24
1 parent ad2e4f9 commit 527ce0f

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
integration-test:
11+
name: go-sqlsmith
12+
runs-on: ubuntu-24.04
13+
14+
services:
15+
mysql:
16+
image: mysql:5.7
17+
env:
18+
MYSQL_ROOT_PASSWORD: root
19+
ports:
20+
- 3306:3306
21+
options: >-
22+
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -proot"
23+
--health-interval=10s
24+
--health-timeout=5s
25+
--health-retries=5
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Go
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: 1.21.0
35+
36+
- name: Wait for MySQL to be ready
37+
run: |
38+
for i in {1..30}; do
39+
if mysqladmin ping -h 127.0.0.1 -uroot -proot --silent; then
40+
echo "MySQL is ready"
41+
break
42+
fi
43+
echo "Waiting for MySQL..."
44+
sleep 2
45+
done
46+
47+
- name: Install dependencies
48+
run: go mod download
49+
50+
- name: Build
51+
run: make
52+
53+
- name: Run integration tests
54+
run: make integration-test

0 commit comments

Comments
 (0)