Skip to content

Commit 81b2905

Browse files
committed
feat: add end-to-end testing workflow with PostgreSQL service and migration steps
1 parent 3b2c500 commit 81b2905

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/tests.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,41 @@ jobs:
5757

5858
- name: Run Unit Tests
5959
run: npm run test
60+
61+
e2e-test:
62+
runs-on: ubuntu-latest
63+
needs: [test]
64+
services:
65+
postgres:
66+
image: postgres:15
67+
ports:
68+
- 5432:5432
69+
env:
70+
POSTGRES_USER: diego
71+
POSTGRES_DB: fullstock_test
72+
POSTGRES_HOST_AUTH_METHOD: trust
73+
options: >-
74+
--health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 5
75+
steps:
76+
- name: Checkout code
77+
uses: actions/checkout@v4
78+
79+
- name: Set up Node
80+
uses: actions/setup-node@v3
81+
with:
82+
node-version: "lts/*"
83+
84+
- name: Install dependencies
85+
run: npm clean-install
86+
87+
- name: Build the application
88+
run: npm run build
89+
90+
- name: Migrate the database
91+
run: npm run test:prisma:migrate:deploy
92+
93+
- name: Seed the database
94+
run: npm run test:prisma:seed
95+
96+
- name: Run E2E Tests
97+
run: npm run test:e2e

0 commit comments

Comments
 (0)