Skip to content

Commit

Permalink
ci: add frontend e2e test workflow during pr and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jul 26, 2024
1 parent d7d704e commit 3f22e19
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ on:
workflow_dispatch:

jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.6.0
backend-test:
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@2.0.0
with:
image_name: ghcr.io/${{ github.repository }}/backend
build_context: src/backend
Expand All @@ -28,22 +28,34 @@ jobs:
coverage: true
secrets: inherit

frontend-tests:
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.6.0
frontend-unit-test:
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@2.0.0
with:
working_dir: src/frontend

frontend-e2e-test:
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@2.0.0
with:
image_name: mcr.microsoft.com/playwright:v1.44.1
build_img: false
compose_file: docker-compose.yml -f contrib/playwright/docker-compose.yml
compose_service: ui-test
cache_extra_imgs: |
"docker.io/postgis/postgis:${{ vars.POSTGIS_TAG }}"
"docker.io/minio/minio:${{ vars.MINIO_TAG }}"
secrets: inherit

backend-build:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
needs: [pytest]
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@2.0.0
needs: [backend-test]
with:
context: src/backend
build_target: prod
image_name: ghcr.io/${{ github.repository }}/backend

frontend-build:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
needs: [frontend-tests]
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@2.0.0
needs: [frontend-unit-test, frontend-e2e-test]
with:
context: src/frontend
dockerfile: prod.dockerfile
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/pr_test_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ on:

jobs:
unit-tests:
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.6.0
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@2.0.0
with:
working_dir: src/frontend

e2e-tests:
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@main
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@2.0.0
with:
container_config: '{"image": "mcr.microsoft.com/playwright:v1.45.1"}'
working_dir: src/frontend
run_command: "test:e2e"
image_name: mcr.microsoft.com/playwright:v1.44.1
build_img: false
compose_file: docker-compose.yml -f contrib/playwright/docker-compose.yml
compose_service: ui-test
cache_extra_imgs: |
"docker.io/postgis/postgis:${{ vars.POSTGIS_TAG }}"
"docker.io/minio/minio:${{ vars.MINIO_TAG }}"
secrets: inherit

0 comments on commit 3f22e19

Please sign in to comment.