From dab082164f6fa7b85f21cdb03d54231fb1a9ce66 Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Tue, 9 Aug 2022 22:00:05 +0200 Subject: [PATCH] setup local env for paywright tests Signed-off-by: Ivan Milchev --- .github/workflows/check-pr.yml | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index d66b67c64..abb89f6cc 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -80,3 +80,54 @@ jobs: service_account_credentials: ${{ secrets.MONDOO_SECRET }} scan_type: k8s path: prod-manifests.yaml + + run-playwright: + name: Run Playwright + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + path: './frontend' + + - name: Checkout + uses: actions/checkout@v3 + with: + repository: podkrepi-bg/api + ref: master + path: './api' + + - name: Run db + working-directory: ./api + run: docker compose up -d pg-db + + - name: Run api + working-directory: ./api + run: docker compose up -d --force-recreate --no-build migrate-db seed-db api keycloak + + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + + - name: Install dependencies + run: yarn + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + - name: Run Playwright tests + run: yarn playwright test e2e/local + + - uses: actions/upload-artifact@v2 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + - name: Setup upterm session + uses: lhotari/action-upterm@v1 + with: + ## limits ssh access and adds the ssh public key for the user which triggered the workflow + limit-access-to-actor: true + ## limits ssh access and adds the ssh public keys of the listed GitHub users + limit-access-to-users: imilchev