-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask-system-postgres-integration-tests.yml
More file actions
54 lines (43 loc) · 1.71 KB
/
task-system-postgres-integration-tests.yml
File metadata and controls
54 lines (43 loc) · 1.71 KB
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
name: Task System PostgreSQL Integration Tests
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
cache: true
- name: Restore dependencies
run: dotnet restore ./src/task_system/task_system_integration_test/task_system_integration_test.csproj
- name: Build project
run: dotnet build ./src/task_system/task_system_integration_test/task_system_integration_test.csproj --configuration Release
- name: Build and Run Docker Compose
run: docker compose -f ./src/task_system/docker-compose.test.yaml up -d
- name: Wait for PostgreSQL to be ready
run: |
for i in {1..10}; do
if docker exec task_system_postgres_test pg_isready -U postgres; then
echo "PostgreSQL is ready"
break
else
echo "Waiting for PostgreSQL..."
sleep 5
fi
done
- name: Run Task System Integration Tests
env:
CONNECTION_STRING: "Host=127.0.0.1;Port=50021;Username=postgres;Password=sa;Database=task_system_db_integration_test"
run: dotnet test ./src/task_system/task_system_integration_test/task_system_integration_test.csproj --configuration Release --verbosity normal
- name: Tear Down Docker Compose
if: always()
run: docker compose -f ./src/task_system/docker-compose.test.yaml down