diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright_admin.yaml similarity index 92% rename from .github/workflows/playwright.yaml rename to .github/workflows/playwright_admin.yaml index 5b78012d6..52ae8dad8 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright_admin.yaml @@ -1,4 +1,8 @@ -on: pull_request +on: + pull_request: + paths: + - "assets/admin/**" + - "assets/shared/**" name: Test @@ -36,7 +40,7 @@ jobs: CI: "true" run: | docker compose run --rm playwright npx playwright install --with-deps - docker compose run --rm playwright npx playwright test + docker compose run --rm playwright npx playwright test admin - uses: actions/upload-artifact@v4 if: always() diff --git a/.github/workflows/playwright_client.yaml b/.github/workflows/playwright_client.yaml new file mode 100644 index 000000000..874d04a4a --- /dev/null +++ b/.github/workflows/playwright_client.yaml @@ -0,0 +1,50 @@ +on: + pull_request: + paths: + - "assets/client/**" + - "assets/shared/**" + +name: Test + +env: + COMPOSE_USER: runner + +jobs: + frontend-build-and-test: + name: Playwright + runs-on: ubuntu-latest + strategy: + fail-fast: true + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup network + run: docker network create frontend + + - name: Composer install + run: | + docker compose run --rm phpfpm composer install + + - name: Copy fixture assets to public/fixtures + run: | + docker compose run --rm phpfpm cp -r fixtures/public/fixtures public/fixtures + + - name: Build assets + run: | + docker compose run --rm node npm install + docker compose run --rm node npm run build + + - name: Run playwright + env: + CI: "true" + run: | + docker compose run --rm playwright npx playwright install --with-deps + docker compose run --rm playwright npx playwright test client + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/.github/workflows/playwright_template.yaml b/.github/workflows/playwright_template.yaml new file mode 100644 index 000000000..3875b23ce --- /dev/null +++ b/.github/workflows/playwright_template.yaml @@ -0,0 +1,50 @@ +on: + pull_request: + paths: + - "assets/template/**" + - "assets/shared/**" + +name: Test + +env: + COMPOSE_USER: runner + +jobs: + frontend-build-and-test: + name: Playwright + runs-on: ubuntu-latest + strategy: + fail-fast: true + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup network + run: docker network create frontend + + - name: Composer install + run: | + docker compose run --rm phpfpm composer install + + - name: Copy fixture assets to public/fixtures + run: | + docker compose run --rm phpfpm cp -r fixtures/public/fixtures public/fixtures + + - name: Build assets + run: | + docker compose run --rm node npm install + docker compose run --rm node npm run build + + - name: Run playwright + env: + CI: "true" + run: | + docker compose run --rm playwright npx playwright install --with-deps + docker compose run --rm playwright npx playwright test template + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30