-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 2.99 KB
/
Copy pathci.yml
File metadata and controls
93 lines (81 loc) · 2.99 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: documentjobdb
POSTGRES_USER: document_user
POSTGRES_PASSWORD: document_password
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U document_user -d documentjobdb"
--health-interval=10s
--health-timeout=5s
--health-retries=10
rabbitmq:
image: rabbitmq:3-management
env:
RABBITMQ_DEFAULT_USER: document_user
RABBITMQ_DEFAULT_PASS: document_password
RABBITMQ_DEFAULT_VHOST: document_processing
ports:
- 5672:5672
- 15672:15672
options: >-
--health-cmd="rabbitmq-diagnostics check_port_connectivity"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Add .NET tools to PATH
run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Install dotnet-ef
run: dotnet tool install --global dotnet-ef
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --no-restore --configuration Release
- name: Apply database migrations
env:
ConnectionStrings__DocumentProcessingDatabase: Host=localhost;Port=5432;Database=documentjobdb;Username=document_user;Password=document_password
RabbitMq__HostName: localhost
RabbitMq__UserName: document_user
RabbitMq__Password: document_password
RabbitMq__VirtualHost: document_processing
RabbitMq__Port: 5672
RabbitMq__ClientName: DocumentProcessingCi
RabbitMq__AutomaticRecoveryEnabled: true
RabbitMq__RequestedHeartbeat: 30
RabbitMq__QueueName: document-processing.jobs
run: |
dotnet ef database update \
--project src/DocumentProcessing.Infrastructure \
--startup-project src/DocumentProcessing.Api
- name: Run tests
env:
ConnectionStrings__DocumentProcessingDatabase: Host=localhost;Port=5432;Database=documentjobdb;Username=document_user;Password=document_password
RabbitMq__HostName: localhost
RabbitMq__UserName: document_user
RabbitMq__Password: document_password
RabbitMq__VirtualHost: document_processing
RabbitMq__Port: 5672
RabbitMq__ClientName: DocumentProcessingCi
RabbitMq__AutomaticRecoveryEnabled: true
RabbitMq__RequestedHeartbeat: 30
RabbitMq__QueueName: document-processing.jobs
run: dotnet test --no-build --configuration Release --verbosity normal --filter "Category!=E2E"