diff --git a/.github/workflows/devRun.yml b/.github/workflows/devRun.yml index 904a403ed..bc79d1047 100644 --- a/.github/workflows/devRun.yml +++ b/.github/workflows/devRun.yml @@ -14,6 +14,7 @@ jobs: - uses: isort/isort-action@v1 - name: Set up Python uses: actions/setup-python@v5 + id: setup-python with: python-version: '3.12' - name: Install Poetry @@ -22,26 +23,24 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true installer-parallel: true - virtualenvs-path: .venv + - name: Load cached virtual environment + id: cache-venv + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install Dependencies + if: steps.cache-venv.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root - name: Install Playwright Browsers run: | PLAYWRIGHT_VERSION=$(grep -E '^playwright = "[^"]*"' pyproject.toml | sed -E 's/playwright = "([^"]*)".*$/\1/') npx playwright@$PLAYWRIGHT_VERSION install --with-deps - - name: Test with pytest - run: | - source .venv/bin/activate - xvfb-run pytest -m devRun --base-url ${{ vars.BASE_URL }} - - name: Cache dependencies if tests pass - if: success() - uses: actions/cache/save@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Run Playwright tests with pytest + run: poetry run xvfb-run pytest -m devRun --base-url ${{ vars.BASE_URL }} - name: Auto-assign reviewers - uses: kentaro-m/auto-assign-action@v2.0.0 if: success() + uses: kentaro-m/auto-assign-action@v2.0.0 - name: Store Playwright Traces and Videos From Failed Tests if: failure() uses: actions/upload-artifact@v4.6.1 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cb51a51c1..2a6239e3e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -38,6 +38,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 + id: setup-python with: python-version: '3.12' - name: Install Poetry @@ -62,8 +63,7 @@ jobs: npx playwright@$PLAYWRIGHT_VERSION install --with-deps - name: Run Tests run: | - source .venv/bin/activate - xvfb-run pytest ${{ github.event.inputs.pytest_command || '-m "not devRun"' }} \ + poetry run xvfb-run pytest ${{ github.event.inputs.pytest_command || '-m "not devRun"' }} \ --base-url ${{ vars.BASE_URL }} \ --splits ${{ github.event.inputs.parallelism || 2 }} \ --group ${{ matrix.group }}