File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 test :
6666 name : Unit Test
6767 runs-on : ubuntu-latest
68+ services :
69+ mysql :
70+ image : mysql:9.0.1
71+ env :
72+ MYSQL_ROOT_PASSWORD : fzu-helper
73+ MYSQL_DATABASE : fzu-helper
74+ MYSQL_USER : fzu-helper
75+ MYSQL_PASSWORD : fzu-helper
76+ ports :
77+ - 3306:3306
78+ options : >-
79+ --health-cmd="mysqladmin ping -h 127.0.0.1 -ufzu-helper -pfzu-helper"
80+ --health-interval=10s
81+ --health-timeout=5s
82+ --health-retries=10
6883 steps :
6984 - name : Checkout
7085 uses : actions/checkout@v7
7792 cache : false
7893 - name : Install dependencies
7994 run : go mod tidy
95+ - name : Initialize test database
96+ run : |
97+ sudo apt-get update
98+ sudo apt-get install -y mysql-client
99+ for file in config/sql/*.sql; do
100+ mysql --protocol=tcp -h 127.0.0.1 -P 3306 -ufzu-helper -pfzu-helper fzu-helper < "$file"
101+ done
80102 - name : Run tests
81103 run : make test # 使用我们自己的测试命令
82104 - name : Check the number of changed lines
You can’t perform that action at this time.
0 commit comments