From 86d8d07f2e61147439b394928e23e9c3f2cc5468 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Thu, 24 Oct 2024 14:20:07 -0700 Subject: [PATCH] Cache playwright --- .github/actions/init-environment/action.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/actions/init-environment/action.yml b/.github/actions/init-environment/action.yml index d4589a2c44..62cc4da631 100644 --- a/.github/actions/init-environment/action.yml +++ b/.github/actions/init-environment/action.yml @@ -30,13 +30,26 @@ runs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --with test --with dev --with docs --all-extras shell: bash - - name: Activate venv run: | source $VENV echo PATH=$PATH >> $GITHUB_ENV shell: bash + - name: Get installed Playwright version + id: playwright-version + run: | + version=$(poetry run playwright/ -V | awk '{print $2}' | tr -d '\n') + echo "version=$version" >> $GITHUB_OUTPUT + shell: bash + + - uses: actions/cache@v4 + id: playwright-cache + with: + path: ${{ matrix.os == 'windows-latest' && '%USERPROFILE%\\AppData\\Local\\ms-playwright' || '~/.cache/ms-playwright' }} + key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}' + - name: Install playwright + if: steps.playwright-cache.outputs.cache-hit != 'true' run: playwright install --with-deps shell: bash