diff --git a/.github/actions/setup-cmux/action.yml b/.github/actions/setup-cmux/action.yml index 4c1fb0d65..dc94d509a 100644 --- a/.github/actions/setup-cmux/action.yml +++ b/.github/actions/setup-cmux/action.yml @@ -18,6 +18,17 @@ runs: shell: bash run: echo "version=$(bun --version)" >> $GITHUB_OUTPUT + - name: Cache Homebrew downloads (macOS) + if: runner.os == 'macOS' + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/Homebrew/downloads + ~/Library/Caches/Homebrew/Cask + key: ${{ runner.os }}-${{ runner.arch }}-homebrew-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-homebrew- + - name: Cache node_modules uses: actions/cache@v4 with: diff --git a/.github/actions/setup-playwright/action.yml b/.github/actions/setup-playwright/action.yml new file mode 100644 index 000000000..3a7be4164 --- /dev/null +++ b/.github/actions/setup-playwright/action.yml @@ -0,0 +1,23 @@ +name: "Setup Playwright" +description: "Install Playwright browsers with caching" +runs: + using: "composite" + steps: + - name: Get Playwright version + id: playwright-version + shell: bash + run: echo "version=$(bun x playwright --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT + + - name: Cache Playwright browsers + uses: actions/cache@v4 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }} + restore-keys: | + ${{ runner.os }}-playwright- + + - name: Install Playwright browsers and dependencies + if: steps.playwright-cache.outputs.cache-hit != 'true' + shell: bash + run: bun x playwright install --with-deps diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 743abdfb4..8d1741793 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,8 +123,7 @@ jobs: - uses: ./.github/actions/setup-cmux - - name: Install Playwright browsers - run: bun x playwright install --with-deps + - uses: ./.github/actions/setup-playwright - name: Build Storybook run: make storybook-build @@ -154,11 +153,7 @@ jobs: sudo apt-get update sudo apt-get install -y xvfb - - name: Install Playwright runtime dependencies - run: bun x playwright install-deps - - - name: Install Playwright browsers - run: bun x playwright install --with-deps + - uses: ./.github/actions/setup-playwright - name: Run e2e tests run: xvfb-run -a make test-e2e