Skip to content

Commit

Permalink
chore(ci): fix running e2e backend tests during CI
Browse files Browse the repository at this point in the history
chore(ci): test

chore(ci): fix credentials

chore(ci): run background idomitc way

chore(ci): specify container

chore(ci): map to host

chore(ci): setup users

chore(ci): add & use wait-on

chore(ci): run wait on sequentially

chore(ci): run wait on sin server step

chore(env): fix in ci

chore(env): simplify
  • Loading branch information
lutangar committed Oct 5, 2023
1 parent 3d48207 commit 4eb5db8
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 24 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,27 @@ on:

env:
BASE_BRANCH: dev
POSTGRES_PASSWORD: postgres
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: admin
DUMMY_EDITOR_EMAIL: [email protected]
DUMMY_EDITOR_PASSWORD: editor

jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -26,5 +43,8 @@ jobs:
- run: npx nx format:check --base=$BASE_BRANCH
- run: npx nx affected --target=lint --parallel=3 --base=origin/$BASE_BRANCH
- run: npx nx affected --target=test --parallel=3 --ci --code-coverage --base=origin/$BASE_BRANCH
- run: npx nx affected --target=e2e --parallel=2 --ci --code-coverage --base=origin/$BASE_BRANCH
- run: |
npx nx serve backend &
npx wait-on http://localhost:3333/api
- run: npx nx e2e backend-e2e
- run: npx nx affected --target=build --parallel=3 --base=origin/$BASE_BRANCH
124 changes: 101 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "^4.0.2",
"vitest": "^0.25.8",
"wait-on": "^7.0.1",
"web-vitals": "^3.1.0",
"whatwg-fetch": "^3.6.2"
},
Expand Down

0 comments on commit 4eb5db8

Please sign in to comment.