Skip to content

Commit 09c425a

Browse files
committed
CI: Add tests for various MySQL versions
1 parent 71e0a12 commit 09c425a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,43 @@ jobs:
4242
go test $(go list ./... | grep -v canal)
4343
go test $(go list ./... | grep canal)
4444
45+
mysqltest:
46+
strategy:
47+
matrix:
48+
mysql_version:
49+
- 8.0.37
50+
- 8.4.0
51+
name: Tests with MySQL ${{ matrix.mysql_version }}
52+
runs-on: ubuntu-latest
53+
services:
54+
mysql:
55+
image: mysql:${{ matrix.mysql_version }}
56+
env:
57+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
58+
ports:
59+
- 3306:3306
60+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
61+
62+
steps:
63+
- name: MySQL versions
64+
run: |
65+
echo -n "MySQL Client: " ; mysql -V
66+
echo -n "MySQL Server: " ; mysql -h 127.0.0.1 -BNe 'SELECT VERSION()'
67+
- name: Prepare for Go
68+
run: |
69+
sudo apt-get install -y make gcc
70+
- name: Checkout code
71+
uses: actions/checkout@v4
72+
- name: Install Go
73+
uses: actions/setup-go@v5
74+
with:
75+
go-version: "1.22"
76+
- name: Run tests
77+
run: |
78+
# separate test to avoid RESET MASTER conflict
79+
go test $(go list ./... | grep -v canal)
80+
go test $(go list ./... | grep canal)
81+
4582
golangci:
4683
name: golangci
4784
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)