-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.01 KB
/
test.yaml
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
name: Test API
on:
push:
branches:
- master
pull_request:
branches:
- "*"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Run tests
runs-on: self-hosted
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and run Docker Compose
run: |
docker compose up --build -d test
docker compose logs -f test > test_logs.txt
continue-on-error: true
- name: Show test logs
run: docker compose logs --no-log-prefix test
continue-on-error: true
- name: Cleanup
run: \
docker compose down -v --rmi all
docker system prune -f
continue-on-error: true
- name: Check test results
run: |
if grep -q "Test Suites: .* failed" test_logs.txt; then
echo "Tests failed"
exit 1
else
echo "Tests passed"
fi