Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/actions/yarn-install-concurrent/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
########################################################################################
# "yarn install concurrent" composite action for concurrent yarn and playwright install #
#--------------------------------------------------------------------------------------#
# This action consolidates yarn-install and yarn-playwright-install patterns while #
# running yarn prisma generate and yarn playwright install concurrently for improved #
# CI build times. Reuses existing caching strategies to avoid code duplication. #
########################################################################################

name: "Yarn install & Playwright install (concurrent)"
description: "Install dependencies and Playwright browsers concurrently for faster CI builds"
inputs:
node_version:
required: false
default: v20.x

runs:
using: "composite"
steps:
# Node.js setup (from yarn-install action)
- name: Use Node ${{ inputs.node_version }}
uses: buildjet/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Expose yarn config as "$GITHUB_OUTPUT"
id: yarn-config
shell: bash
run: |
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

# Yarn caching (from yarn-install action)
- name: Restore yarn cache
uses: buildjet/cache@v4
id: yarn-download-cache
with:
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}

- name: Restore node_modules
id: yarn-nm-cache
uses: buildjet/cache@v4
with:
path: "**/node_modules/"
key: ${{ runner.os }}-yarn-nm-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}

- name: Restore yarn install state
id: yarn-install-state-cache
uses: buildjet/cache@v4
with:
path: .yarn/ci-cache/
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}

# Playwright caching (from yarn-playwright-install action)
- name: Get installed Playwright version
shell: bash
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
- name: Cache playwright binaries
id: playwright-cache
uses: buildjet/cache@v4
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

# Concurrent installation: yarn install -> (yarn prisma generate || yarn playwright install)
- name: Install dependencies with concurrent playwright
shell: bash
run: |
# Run yarn install first
yarn install --inline-builds

# Then run yarn prisma generate and yarn playwright install concurrently
yarn prisma generate &
yarn playwright install --with-deps &
wait
env:
# CI optimizations (from yarn-install action)
YARN_ENABLE_IMMUTABLE_INSTALLS: "false"
YARN_ENABLE_GLOBAL_CACHE: "false"
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz
YARN_NM_MODE: "hardlinks-local"
HUSKY: "0"
3 changes: 1 addition & 2 deletions .github/workflows/e2e-app-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/yarn-install-concurrent
- uses: ./.github/actions/cache-db
env:
DATABASE_URL: ${{ secrets.CI_DATABASE_URL }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/e2e-embed-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/yarn-install-concurrent
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/e2e-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/yarn-install-concurrent
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/yarn-install-concurrent
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/merge-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/yarn-install-concurrent
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/yarn-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ permissions:
contents: read

jobs:
setup:
yarn-install:
name: Yarn install & cache
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install

playwright-install:
name: Playwright install & cache
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-playwright-install
Loading