Skip to content

Commit 7e501a3

Browse files
committed
Add e2e CI workflow
1 parent 14122af commit 7e501a3

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/e2e_tests.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: e2e tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
10+
concurrency:
11+
group: e2e-tests-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
e2e-tests:
16+
name: e2e tests
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 5
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
ruby_version: ["3.4.5"]
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Set up `.env` file
30+
run: |
31+
cd .devcontainer
32+
cp .env.example .env
33+
34+
- name: Build sentry-test-services
35+
run: docker compose --file .devcontainer/docker-compose.yml build sentry-test-services
36+
37+
- name: Start test services
38+
run: docker compose --file .devcontainer/docker-compose.yml up -d sentry-test-services
39+
40+
- name: Wait for services to be fully ready
41+
run: |
42+
cd .devcontainer
43+
source .env
44+
echo "⏳ Waiting for services to be fully ready..."
45+
46+
# Wait for Rails app to respond with 200
47+
timeout 90 bash -c 'until docker compose --profile e2e run --rm sentry-test curl -s -o /dev/null -w "%{http_code}" http://sentry-test-services:4000/health | grep -q "200"; do echo "Waiting for Rails app..."; sleep 2; done' || (echo "❌ Rails app failed to become ready" && exit 1)
48+
echo "✅ Rails app is ready"
49+
50+
# Wait for Svelte app to respond with 200
51+
timeout 90 bash -c 'until docker compose --profile e2e run --rm sentry-test curl -s -o /dev/null -w "%{http_code}" http://sentry-test-services:4001/health | grep -q "200"; do echo "Waiting for Svelte app..."; sleep 2; done' || (echo "❌ Svelte app failed to become ready" && exit 1)
52+
echo "✅ Svelte app is ready"
53+
54+
- name: Build sentry-test
55+
run: docker compose --file .devcontainer/docker-compose.yml build sentry-test
56+
57+
- name: Run e2e tests
58+
run: docker compose --file .devcontainer/docker-compose.yml run --rm sentry-test bundle exec rake
59+
60+
- name: Stop e2e services
61+
if: always()
62+
run: |
63+
cd .devcontainer
64+
source .env
65+
docker compose --profile e2e down
66+
67+
- name: Upload test artifacts
68+
if: failure()
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: e2e-test-logs-ruby-${{ matrix.ruby_version }}
72+
path: |
73+
log/sentry_debug_events.log
74+
retention-days: 7
75+
76+
- # Temp fix
77+
# https://github.com/docker/build-push-action/issues/252
78+
# https://github.com/moby/buildkit/issues/1896
79+
name: Move cache
80+
run: |
81+
rm -rf ${{ runner.temp }}/.buildx-cache
82+
mv ${{ runner.temp }}/.buildx-cache-new ${{ runner.temp }}/.buildx-cache

0 commit comments

Comments
 (0)