-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.36 KB
/
test-application.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
name: Test application
on:
workflow_call:
workflow_dispatch:
pull_request:
branches: [main]
jobs:
test-application:
name: Test application
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Start dependencies for tests (docker compose)
run: |
docker compose up -d & # Run in background and disown the process
disown
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Wait for docker compose services to be ready and database migration to complete
run: |
timeout 5m bash -c '
while ! docker ps | grep -q "(healthy)"; do
echo "Waiting for services to be healthy..."
sleep 5
done
while docker ps -a | grep -q "database_migration"; do
if docker ps -a | grep -q "Exited.*database_migration"; then
echo "Database migration completed."
break
fi
echo "Waiting for database migration to complete..."
sleep 5
done
'
- name: Test
run: dotnet test --no-build --configuration Release