-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.61 KB
/
tests.yml
File metadata and controls
65 lines (52 loc) · 1.61 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
name: Run Project Tests
on:
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: "9.0.x"
- name: Run Unit Tests
run: dotnet test PhantomDave.BankTracking.UnitTests/
- name: Run Integration Tests
run: dotnet test PhantomDave.BankTracking.IntegrationTests/
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install Dependencies
working-directory: frontend
run: npm ci
- name: Install Playwright
working-directory: frontend
run: npx playwright install --with-deps chromium
- name: Start Database
run: docker compose -f compose.dev.yaml up -d database
- name: Start Backend API
run: |
dotnet build PhantomDave.BankTracking.Api/
nohup dotnet run --project PhantomDave.BankTracking.Api/ --urls=http://localhost:5095 > api.log 2>&1 &
- name: Wait for Backend API
run: |
for i in {1..30}; do
if curl -s http://localhost:5095/graphql > /dev/null; then
echo "API is up!"
exit 0
fi
echo "Waiting for API..."
sleep 2
done
echo "API did not start in time" >&2
exit 1
- name: Run E2E Tests
working-directory: frontend
run: npm run test:e2e