Skip to content

Commit 4b3c986

Browse files
Refactor E2E test workflow to use local Supabase instance and improve service readiness checks
1 parent 1d42374 commit 4b3c986

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@ jobs:
1010
e2e-tests:
1111
runs-on: ubuntu-latest
1212

13-
services:
14-
postgres:
15-
image: postgres:15
16-
env:
17-
POSTGRES_PASSWORD: postgres
18-
POSTGRES_DB: postgres
19-
options: >-
20-
--health-cmd pg_isready
21-
--health-interval 10s
22-
--health-timeout 5s
23-
--health-retries 5
24-
ports:
25-
- 5432:5432
26-
2713
steps:
2814
- name: Checkout code
2915
uses: actions/checkout@v4
@@ -39,26 +25,52 @@ jobs:
3925

4026
- name: Install Supabase CLI
4127
run: |
28+
# Remove any existing supabase binary
29+
rm -f supabase
30+
# Download and extract
4231
curl -fsSL https://github.com/supabase/cli/releases/download/v1.123.4/supabase_linux_amd64.tar.gz | tar -xz
32+
# Make executable and move to system path
33+
chmod +x supabase
4334
sudo mv supabase /usr/local/bin/
35+
# Verify installation
36+
supabase --version
37+
38+
- name: Start Docker
39+
run: |
40+
sudo systemctl start docker
41+
sudo usermod -aG docker $USER
4442
4543
- name: Start Supabase local instance
4644
run: |
45+
# Start Supabase with existing config
4746
supabase start
48-
sleep 10
47+
# Wait for services to be ready
48+
sleep 15
49+
# Verify services are running
50+
supabase status
4951
5052
- name: Install Playwright browsers
5153
run: npx playwright install --with-deps
5254

5355
- name: Start Angular app
5456
run: |
57+
# Start Angular with local configuration
5558
npm run start:local &
59+
# Wait for app to start
5660
sleep 30
5761
# Wait for app to be ready
5862
timeout 60 bash -c 'until curl -f http://localhost:4200; do sleep 2; done'
63+
env:
64+
# Set environment variables for local Supabase
65+
SUPABASE_URL: http://127.0.0.1:54321
66+
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
5967

6068
- name: Run E2E tests
6169
run: npm run e2e:local
70+
env:
71+
# Ensure E2E tests use local Supabase
72+
SUPABASE_URL: http://127.0.0.1:54321
73+
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
6274

6375
- name: Upload test results
6476
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)