Skip to content

Disable mariadb healthcheck #28

Disable mariadb healthcheck

Disable mariadb healthcheck #28

Workflow file for this run

name: .NET
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
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: gangs
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping --silent" --health-interval 10s
mariadb:
image: mariadb:latest
env:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
MARIADB_DATABASE: gangs
ports:
- 3307:3306
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Cache .NET packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test with MySQL
env:
DB_CONNECTION_STRING: "Server=localhost;Port=3306;Database=gangs;User=root"
run: dotnet test GangsTest/GangsTest.csproj --no-build --verbosity normal
- name: Test with MariaDB
env:
DB_CONNECTION_STRING: "Server=localhost;Port=3307;Database=gangs;User=root"
run: dotnet test GangsTest/GangsTest.csproj --no-build --verbosity normal