-
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 2.62 KB
/
Copy pathintegration-tests.yml
File metadata and controls
98 lines (83 loc) · 2.62 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
94
95
96
97
98
name: Integration Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * *' # Run daily at 2 AM
jobs:
integration:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: courierx
POSTGRES_PASSWORD: password
POSTGRES_DB: courierx_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
env:
DATABASE_URL: postgresql://courierx:password@localhost:5432/courierx_test
REDIS_URL: redis://localhost:6379/0
GO_CORE_URL: http://localhost:8080
RAILS_URL: http://localhost:4000
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: control-plane
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install dependencies
run: |
cd control-plane && bundle install
cd ../apps/core-go && go mod download
- name: Set up database
working-directory: control-plane
run: |
bundle exec rails db:create
bundle exec rails db:migrate || echo "No migrations yet"
bundle exec rails db:seed || echo "No seeds yet"
- name: Start Go Core
working-directory: apps/core-go
run: |
go build -o courierx-core .
./courierx-core &
sleep 5
- name: Start Rails API
working-directory: control-plane
run: |
bundle exec rails server -p 4000 &
sleep 10
- name: Wait for services
run: |
timeout 60 bash -c 'until curl -f http://localhost:4000/health; do sleep 2; done' || echo "Rails health endpoint not implemented yet"
timeout 60 bash -c 'until curl -f http://localhost:8080/health; do sleep 2; done' || echo "Go health endpoint may not be reachable"
- name: Run integration tests
working-directory: control-plane
run: bundle exec rspec spec/integration/ || echo "Integration tests skipped - not yet implemented"
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: integration-logs
path: |
control-plane/log/test.log
apps/core-go/*.log