From 32bf9f146fdc582359f14fbc1ec52eaabbed8a42 Mon Sep 17 00:00:00 2001 From: Aashwin Mohan Date: Thu, 16 May 2024 09:42:16 +0100 Subject: [PATCH] E2E Workflow --- .github/workflows/e2e.yaml | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/e2e.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 0000000..42aafc8 --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,72 @@ +name: E2E Tests Workflow +on: + pull_request: + schedule: + - cron: '0 8 * * *' + workflow_dispatch: + inputs: + rvvupHyvaCheckoutVersion: + description: 'Rvvup Hyva Checkout Version' + required: true + default: 'dev-main' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + end-2-end-tests: + strategy: + matrix: + include: + - MAGENTO_VERSION: 2.4.5 + - MAGENTO_VERSION: 2.4.6 + - MAGENTO_VERSION: 2.4.7 + + env: + MAGENTO_VERSION: ${{ matrix.MAGENTO_VERSION }} + RVVUP_HYVA_CHECKOUT_VERSION: ${{ github.event.inputs.rvvupHyvaCheckoutVersion || format('dev-{0}', github.head_ref || github.ref_name) }} + MAGENTO_REPO_PUBLIC_KEY: ${{ secrets.REPO_PUB_KEY }} + MAGENTO_REPO_PRIVATE_KEY: ${{ secrets.REPO_SEC_KEY }} + RVVUP_API_KEY: ${{ secrets.RVVUP_API_KEY }} + HYVA_SSH_PRIVATE_KEY: ${{ secrets.HYVA_SSH_PRIVATE_KEY }} + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Start Docker + run: | + docker compose up -d --build + + - name: Install dependencies + run: npm install + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + - name: Wait for Magento Store + uses: mydea/action-wait-for-api@v1.0.0 + with: + url: http://local.dev.rvvuptech.com/magento_version + method: GET + expected-status: "200" + timeout: "500" + interval: "5" + + - name: Run Playwright tests + run: TEST_BASE_URL=http://local.dev.rvvuptech.com npx playwright test + + - name: Prepare logs + if: always() + run: | + mkdir -p logs + docker-compose logs > logs/container_logs.log + docker cp magento-hyva-checkout-magento-1:/bitnami/magento/var/log logs + - uses: actions/upload-artifact@v4 + if: always() + with: + name: results-${{ matrix.MAGENTO_VERSION }}-${{ github.run_number }} + path: | + playwright-report/ + var/log/ + magento.log + nginx-proxy.log +