ci: fix Playwright browser caching in TypeScript workflow (#6840)
* ci: Optimize Playwright browser caching in TypeScript workflow * ci: Upgrade Playwright cache action to v4 --------- Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
This commit is contained in:
parent
bca49a3335
commit
0108f2f475
1 changed files with 16 additions and 6 deletions
22
.github/workflows/typescript_test.yml
vendored
22
.github/workflows/typescript_test.yml
vendored
|
|
@ -53,8 +53,9 @@ env:
|
||||||
NODE_VERSION: "21"
|
NODE_VERSION: "21"
|
||||||
PYTHON_VERSION: "3.13"
|
PYTHON_VERSION: "3.13"
|
||||||
# Define the directory where Playwright browsers will be installed.
|
# Define the directory where Playwright browsers will be installed.
|
||||||
# Adjust if your project uses a different path.
|
# This path is used for caching across workflows
|
||||||
PLAYWRIGHT_BROWSERS_PATH: "ms-playwright"
|
PLAYWRIGHT_BROWSERS_PATH: "ms-playwright"
|
||||||
|
PLAYWRIGHT_VERSION: "1.49.1" # Add explicit version for cache key
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
determine-test-suite:
|
determine-test-suite:
|
||||||
|
|
@ -251,12 +252,21 @@ jobs:
|
||||||
run: npm ci
|
run: npm ci
|
||||||
working-directory: ./src/frontend
|
working-directory: ./src/frontend
|
||||||
|
|
||||||
- name: Install Playwright Browser Dependencies
|
# Cache Playwright browsers using a composite key
|
||||||
id: install-playwright
|
- name: Cache Playwright Browsers
|
||||||
uses: ./.github/actions/install-playwright
|
id: cache-playwright
|
||||||
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
working-directory: ./src/frontend
|
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
|
||||||
browsers: chromium
|
key: playwright-${{ env.PLAYWRIGHT_VERSION }}-chromium-${{ runner.os }}
|
||||||
|
restore-keys: |
|
||||||
|
playwright-${{ env.PLAYWRIGHT_VERSION }}-chromium-${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Install Playwright Browser Dependencies
|
||||||
|
if: steps.cache-playwright.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cd ./src/frontend
|
||||||
|
npx playwright install --with-deps chromium
|
||||||
|
|
||||||
- name: Setup Python Environment with UV
|
- name: Setup Python Environment with UV
|
||||||
uses: ./.github/actions/setup-uv
|
uses: ./.github/actions/setup-uv
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue