-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.27 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: .NET
on:
push:
pull_request:
jobs:
db:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
env:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
MARIADB_DATABASE: gangs
ports:
- 3306:3306
steps:
- name: Wait for MariaDB
run: |
until mysqladmin ping -h "localhost" --silent; do
echo "Waiting for database connection..."
sleep 2
done
build:
runs-on: ubuntu-latest
needs: db
strategy:
matrix:
dotnet-version: [ 6.0.x, 7.0.x, 8.0.x, 9.0.x ] # Test on multiple .NET versions
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
run: dotnet test GangsTest/GangsTest.csproj --no-build --verbosity normal