2024-11-08 14:24:22 +03:00
|
|
|
name: CI E2E Tests
|
2024-08-27 12:07:10 +03:00
|
|
|
on:
|
|
|
|
push:
|
2024-11-08 14:24:22 +03:00
|
|
|
branches:
|
|
|
|
- main
|
2024-08-27 12:07:10 +03:00
|
|
|
pull_request:
|
2024-11-08 14:24:22 +03:00
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2024-08-27 12:07:10 +03:00
|
|
|
jobs:
|
|
|
|
test:
|
2024-11-08 15:53:38 +03:00
|
|
|
timeout-minutes: 30
|
2024-08-27 12:07:10 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-11-08 14:24:22 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2024-08-27 12:07:10 +03:00
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: lts/*
|
2024-10-21 13:02:14 +03:00
|
|
|
|
|
|
|
- name: Check for changed files
|
2024-11-08 14:24:22 +03:00
|
|
|
id: changed-files
|
|
|
|
uses: tj-actions/changed-files@v11
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
packages/**
|
|
|
|
playwright.config.ts
|
2024-10-21 13:02:14 +03:00
|
|
|
|
|
|
|
- name: Skip if no relevant changes
|
2024-11-08 14:24:22 +03:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'false'
|
|
|
|
run: echo "No relevant changes detected. Marking as valid."
|
2024-10-21 13:02:14 +03:00
|
|
|
|
2024-08-27 12:07:10 +03:00
|
|
|
- name: Install dependencies
|
2024-10-21 13:02:14 +03:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2024-11-08 14:24:22 +03:00
|
|
|
uses: ./.github/workflows/actions/yarn-install
|
2024-08-27 12:07:10 +03:00
|
|
|
- name: Install Playwright Browsers
|
2024-10-21 13:02:14 +03:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2024-08-27 12:07:10 +03:00
|
|
|
run: yarn playwright install --with-deps
|
|
|
|
- name: Run Playwright tests
|
2024-10-21 13:02:14 +03:00
|
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
2024-08-27 12:07:10 +03:00
|
|
|
run: yarn test:e2e companies
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: playwright-report
|
|
|
|
path: playwright-report/
|
|
|
|
retention-days: 30
|