From 6cb7bfec6fa510cfc1e4499bdab5afff778b2fbe Mon Sep 17 00:00:00 2001 From: Tamas Pallos Date: Thu, 2 Mar 2023 10:27:41 +0200 Subject: [PATCH] Add e2e tests CI workflow --- .github/workflows/docker-build.yml | 5 ++++ .github/workflows/run-cypress-tests.yml | 32 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/run-cypress-tests.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index a8bb2a12..ce26b236 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -59,3 +59,8 @@ jobs: --cache-from type=registry,ref=$IMAGE_NAME:builder \ --tag $IMAGE_NAME:latest \ . + + run_cypress_tests: + needs: + - push_to_registry + uses: ./.github/workflows/run-cypress-tests.yml diff --git a/.github/workflows/run-cypress-tests.yml b/.github/workflows/run-cypress-tests.yml new file mode 100644 index 00000000..2ce59b80 --- /dev/null +++ b/.github/workflows/run-cypress-tests.yml @@ -0,0 +1,32 @@ +name: Run cypress tests + +on: + # this workflow is only called by others, won't be executed on itself + # as it uses the pre-built docker image that is produced in the upstream job + workflow_call: + +jobs: + run_cypress_tests: + name: Run cypress e2e tests from docker + runs-on: ubuntu-20.04 + + steps: + - name: Collect Workflow Telemetry + uses: runforesight/foresight-workflow-kit-action@v1 + if: ${{ always() }} + with: + api_key: ${{ secrets.FORESIGHT_GITHUB_ACTIONS }} + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Extract metadata to env variables + uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1 + + - name: Start e2e env + uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v1 + with: + hastus_version: "${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }}" + + - name: Run e2e tests from github action + uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@run-cypress-tests-v1