E2E Tests Workflow #910
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Tests Workflow | |
on: | |
pull_request: | |
merge_group: | |
schedule: | |
- cron: '0 8 * * *' | |
workflow_dispatch: | |
inputs: | |
rvvupPluginVersion: | |
description: 'Rvvup Plugin 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: | |
fail-fast: false | |
matrix: | |
include: | |
- MAGENTO_VERSION: 2.4.5 | |
- MAGENTO_VERSION: 2.4.6 | |
- MAGENTO_VERSION: 2.4.7 | |
env: | |
MAGENTO_VERSION: ${{ matrix.MAGENTO_VERSION }} | |
RVVUP_PLUGIN_VERSION: ${{ github.event.inputs.rvvupPluginVersion || 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 }} | |
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/[email protected] | |
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://localhost npx playwright test | |
- name: Prepare logs | |
if: always() | |
run: | | |
mkdir -p logs/magento | |
docker compose logs > logs/container_logs.log | |
docker cp magento-plugin-magento-1:/bitnami/magento/var/log logs/magento | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: results-${{ matrix.MAGENTO_VERSION }}-${{ github.run_number }} | |
path: | | |
playwright-report/ | |
logs/ | |