-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (59 loc) · 1.74 KB
/
test.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Test
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start test environment
run: |
docker-compose up -d
docker ps -a
- name: Make wait-for-it.sh executable
run: chmod +x .github/scripts/wait-for-it.sh
- name: Wait for services
run: |
.github/scripts/wait-for-it.sh localhost:7700 -t 60
.github/scripts/wait-for-it.sh localhost:3000 -t 60
.github/scripts/wait-for-it.sh localhost:8080 -t 60
sleep 10 # Give services extra time to fully initialize
- name: Debug service logs
if: always()
run: |
echo "=== Meilisearch Logs ==="
docker-compose logs meilisearch
echo "=== Playground Logs ==="
docker-compose logs playground
echo "=== Scraper Logs ==="
docker-compose logs scraper
echo "=== Redis Logs ==="
docker-compose logs redis
- name: Run tests
run: npm run test
- name: Show test logs on failure
if: failure()
run: |
echo "=== Service Status ==="
docker-compose ps
echo "=== Recent Logs ==="
docker-compose logs --tail=100
- name: Cleanup
if: always()
run: docker-compose down -v