Skip to content

Commit

Permalink
Add MySQL server for test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Aug 31, 2024
1 parent a8056a0 commit a0b676f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
dotnet-version: [ 6.0.x, 7.0.x, 8.0.x, 9.0.x ] # Test on multiple .NET versions

services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: gang
MYSQL_USER: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v4

Expand All @@ -30,6 +40,13 @@ jobs:
restore-keys: |
${{ runner.os }}-nuget-
- name: Wait for MySQL
run: |
until mysqladmin ping -h "localhost" --silent; do
echo "Waiting for database connection..."
sleep 2
done
- name: Restore dependencies
run: dotnet restore

Expand Down

0 comments on commit a0b676f

Please sign in to comment.