Skip to content

Commit e26484e

Browse files
authored
Merge branch 'main' into out-of-office
2 parents b21a811 + 897c9d6 commit e26484e

File tree

720 files changed

+33906
-13191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

720 files changed

+33906
-13191
lines changed

.easignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# EAS Build ignore file for monorepo
2+
# Only upload the companion app folder
3+
4+
# ===========================================
5+
# IGNORE EVERYTHING AT ROOT LEVEL
6+
# ===========================================
7+
/*
8+
9+
# ===========================================
10+
# EXCEPT THE COMPANION APP
11+
# ===========================================
12+
!companion
13+
14+
# ===========================================
15+
# BUT IGNORE THESE INSIDE COMPANION
16+
# ===========================================
17+
18+
# Native folders - EAS generates these during builds (~2.1 GB)
19+
companion/ios
20+
companion/android
21+
22+
# Dependencies - EAS installs these during builds (~1.6 GB)
23+
companion/node_modules
24+
25+
# Expo build cache
26+
companion/.expo
27+
companion/dist
28+
companion/web-build
29+
30+
# Metro
31+
companion/.metro-health-check*
32+
33+
# WXT Chrome Extension outputs (not needed for mobile builds)
34+
companion/.output
35+
companion/.wxt
36+
companion/dev
37+
38+
# Kotlin cache
39+
companion/.kotlin
40+
41+
# Build artifacts
42+
companion/*.jks
43+
companion/*.p8
44+
companion/*.p12
45+
companion/*.key
46+
companion/*.mobileprovision
47+
48+
# Debug logs
49+
companion/*.log
50+
51+
# TypeScript build info
52+
companion/*.tsbuildinfo
53+
54+
# Environment files
55+
companion/.env
56+
companion/.env.*
57+
!companion/.env.example
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Generate cache-build key
2+
description: "Generate the cache key for production build caching"
3+
inputs:
4+
branch_key:
5+
required: true
6+
description: "Branch key for cache scoping (e.g., github.head_ref for PRs)"
7+
outputs:
8+
key:
9+
description: "The generated cache key"
10+
value: ${{ steps.generate-key.outputs.key }}
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Generate cache key
15+
id: generate-key
16+
shell: bash
17+
env:
18+
CACHE_NAME: prod-build
19+
BRANCH_KEY: ${{ inputs.branch_key }}
20+
LOCKFILE_HASH: ${{ hashFiles('yarn.lock') }}
21+
SOURCE_HASH: ${{ hashFiles('apps/**/**.[jt]s', 'apps/**/**.[jt]sx', 'apps/**/*.json', 'apps/**/*.css', 'packages/**/**.[jt]s', 'packages/**/**.[jt]sx', 'packages/prisma/schema.prisma', 'packages/prisma/migrations/**/*.sql', '!**/node_modules/**', '!packages/prisma/generated/**', '!packages/prisma/client/**', '!packages/prisma/zod/**', '!packages/kysely/**') }}
22+
run: |
23+
echo "key=${CACHE_NAME}-${BRANCH_KEY}-${LOCKFILE_HASH}-${SOURCE_HASH}" >> $GITHUB_OUTPUT
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
name: Cache production build binaries
22
description: "Cache or restore if necessary"
3-
inputs:
4-
node_version:
5-
required: false
6-
default: v18.x
73
runs:
84
using: "composite"
95
steps:
6+
- name: Generate cache key
7+
id: cache-key
8+
uses: ./.github/actions/cache-build-key
9+
with:
10+
branch_key: ${{ github.head_ref || github.ref_name }}
11+
- name: Cache production build
12+
uses: actions/cache@v4
13+
id: cache-build
14+
with:
15+
path: |
16+
${{ github.workspace }}/apps/web/.next
17+
${{ github.workspace }}/apps/web/public/embed
18+
**/.turbo/**
19+
**/dist/**
20+
key: ${{ steps.cache-key.outputs.key }}
1021
- run: |
1122
export NODE_OPTIONS="--max_old_space_size=8192"
1223
yarn build
24+
if: steps.cache-build.outputs.cache-hit != 'true'
1325
shell: bash
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Generate cache-db key
2+
description: "Generate the cache key for database caching"
3+
inputs:
4+
path:
5+
required: false
6+
default: "backups/backup.sql"
7+
description: "Path to the backup file"
8+
outputs:
9+
key:
10+
description: "The generated cache key"
11+
value: ${{ steps.generate-key.outputs.key }}
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Generate cache key
16+
id: generate-key
17+
shell: bash
18+
env:
19+
CACHE_NAME: cache-db
20+
PATH_KEY: ${{ inputs.path }}
21+
PRISMA_HASH: ${{ hashFiles('packages/prisma/schema.prisma', 'packages/prisma/migrations/**/**.sql', 'packages/prisma/*.ts') }}
22+
run: |
23+
echo "key=${CACHE_NAME}-${PATH_KEY}-${PRISMA_HASH}" >> $GITHUB_OUTPUT

.github/actions/cache-db/action.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,26 @@ inputs:
77
path:
88
required: false
99
default: "backups/backup.sql"
10-
COMMIT_SHA:
11-
required: false
12-
default: ""
13-
description: "Commit SHA to include in cache key (passed from workflow)"
1410
runs:
1511
using: "composite"
1612
steps:
13+
- name: Generate cache key
14+
id: cache-key
15+
uses: ./.github/actions/cache-db-key
16+
with:
17+
path: ${{ inputs.path }}
1718
- name: Cache database
1819
id: cache-db
19-
uses: buildjet/cache@v4
20+
uses: actions/cache@v4
2021
env:
21-
cache-name: cache-db
22-
key-1: ${{ hashFiles('packages/prisma/schema.prisma', 'packages/prisma/migrations/**/**.sql', 'packages/prisma/*.ts') }}
23-
key-2: ${{ github.event.pull_request.number || github.ref }}
24-
key-3: ${{ inputs.COMMIT_SHA || github.event.pull_request.head.sha || github.sha }}
2522
DATABASE_URL: ${{ inputs.DATABASE_URL }}
2623
DATABASE_DIRECT_URL: ${{ inputs.DATABASE_URL }}
2724
E2E_TEST_CALCOM_QA_EMAIL: ${{ inputs.E2E_TEST_CALCOM_QA_EMAIL }}
2825
E2E_TEST_CALCOM_QA_PASSWORD: ${{ inputs.E2E_TEST_CALCOM_QA_PASSWORD }}
2926
E2E_TEST_CALCOM_QA_GCAL_CREDENTIALS: ${{ inputs.E2E_TEST_CALCOM_QA_GCAL_CREDENTIALS }}
3027
with:
3128
path: ${{ inputs.path }}
32-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}
29+
key: ${{ steps.cache-key.outputs.key }}
3330
- run: yarn db-seed
3431
if: steps.cache-db.outputs.cache-hit != 'true'
3532
shell: bash

.github/actions/docker-build-and-test/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ runs:
9191
docker compose logs database
9292
9393
- name: Set up Docker Buildx
94-
uses: docker/setup-buildx-action@v3
94+
uses: useblacksmith/setup-docker-builder@v1
9595
with:
9696
driver-opts: |
9797
network=container:database
@@ -100,7 +100,7 @@ runs:
100100
101101
- name: Build image
102102
id: docker_build
103-
uses: docker/build-push-action@v6
103+
uses: useblacksmith/build-push-action@v2
104104
with:
105105
context: ./
106106
file: ./Dockerfile
@@ -159,7 +159,7 @@ runs:
159159

160160
- name: Push image
161161
id: docker_push
162-
uses: docker/build-push-action@v6
162+
uses: useblacksmith/build-push-action@v2
163163
if: ${{ inputs.push-image == 'true' && !github.event.release.prerelease }}
164164
with:
165165
context: ./

.github/actions/yarn-install/action.yml

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ inputs:
1515
node_version:
1616
required: false
1717
default: v20.x
18+
skip-install-if-cache-hit:
19+
description: "Skip yarn install if node_modules cache is hit. Use this for jobs that only need to check that cache exists."
20+
required: false
21+
default: "false"
1822

1923
runs:
2024
using: "composite"
2125
steps:
2226
- name: Use Node ${{ inputs.node_version }}
23-
uses: buildjet/setup-node@v4
27+
uses: actions/setup-node@v4
2428
with:
2529
node-version: ${{ inputs.node_version }}
2630
- name: Expose yarn config as "$GITHUB_OUTPUT"
@@ -29,36 +33,86 @@ runs:
2933
run: |
3034
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
3135
36+
# When skip-install-if-cache-hit is true, first check if all caches exist without downloading (lookup-only mode)
37+
# This avoids downloading ~1.2GB of cache data when we just want to verify caches exist
38+
- name: Check yarn cache (lookup-only)
39+
if: ${{ inputs.skip-install-if-cache-hit == 'true' }}
40+
uses: actions/cache/restore@v4
41+
id: yarn-download-cache-check
42+
with:
43+
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
44+
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}
45+
lookup-only: true
46+
47+
- name: Check node_modules cache (lookup-only)
48+
if: ${{ inputs.skip-install-if-cache-hit == 'true' }}
49+
uses: actions/cache/restore@v4
50+
id: yarn-nm-cache-check
51+
with:
52+
path: |
53+
**/node_modules/
54+
!**/.next/node_modules/
55+
key: ${{ runner.os }}-yarn-nm-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
56+
lookup-only: true
57+
58+
- name: Check yarn install state cache (lookup-only)
59+
if: ${{ inputs.skip-install-if-cache-hit == 'true' }}
60+
uses: actions/cache/restore@v4
61+
id: yarn-install-state-cache-check
62+
with:
63+
path: .yarn/ci-cache/
64+
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
65+
lookup-only: true
66+
67+
# Compute whether all caches hit (only in skip mode)
68+
- name: Check if all caches hit
69+
if: ${{ inputs.skip-install-if-cache-hit == 'true' }}
70+
id: all-caches-check
71+
shell: bash
72+
run: |
73+
if [[ "${{ steps.yarn-download-cache-check.outputs.cache-hit }}" == "true" && \
74+
"${{ steps.yarn-nm-cache-check.outputs.cache-hit }}" == "true" && \
75+
"${{ steps.yarn-install-state-cache-check.outputs.cache-hit }}" == "true" ]]; then
76+
echo "all-hit=true" >> $GITHUB_OUTPUT
77+
else
78+
echo "all-hit=false" >> $GITHUB_OUTPUT
79+
fi
80+
3281
# Yarn rotates the downloaded cache archives, @see https://github.com/actions/setup-node/issues/325
3382
# Yarn cache is also reusable between arch and os.
83+
# Only restore if not in skip mode, or if skip mode but any cache check missed
3484
- name: Restore yarn cache
35-
uses: buildjet/cache@v4
85+
if: ${{ inputs.skip-install-if-cache-hit != 'true' || steps.all-caches-check.outputs.all-hit != 'true' }}
86+
uses: actions/cache@v4
3687
id: yarn-download-cache
3788
with:
3889
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
3990
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}
4091

4192
# Invalidated on yarn.lock changes
4293
- name: Restore node_modules
94+
if: ${{ inputs.skip-install-if-cache-hit != 'true' || steps.all-caches-check.outputs.all-hit != 'true' }}
4395
id: yarn-nm-cache
44-
uses: buildjet/cache@v4
96+
uses: actions/cache@v4
4597
with:
46-
path: "**/node_modules/"
98+
path: |
99+
**/node_modules/
100+
!**/.next/node_modules/
47101
key: ${{ runner.os }}-yarn-nm-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
48102

49103
# Invalidated on yarn.lock changes
50104
- name: Restore yarn install state
105+
if: ${{ inputs.skip-install-if-cache-hit != 'true' || steps.all-caches-check.outputs.all-hit != 'true' }}
51106
id: yarn-install-state-cache
52-
uses: buildjet/cache@v4
107+
uses: actions/cache@v4
53108
with:
54109
path: .yarn/ci-cache/
55110
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
56111

57112
- name: Install dependencies
113+
if: ${{ inputs.skip-install-if-cache-hit != 'true' || steps.all-caches-check.outputs.all-hit != 'true' }}
58114
shell: bash
59-
run: |
60-
yarn install --inline-builds
61-
yarn prisma generate
115+
run: yarn install --inline-builds
62116
env:
63117
# CI optimizations. Overrides yarnrc.yml options (or their defaults) in the CI action.
64118
YARN_ENABLE_IMMUTABLE_INSTALLS: "false" # So it doesn't try to remove our private submodule deps
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
11
name: Install playwright binaries
22
description: "Install playwright, cache and restore if necessary"
3+
inputs:
4+
skip-install-if-cache-hit:
5+
description: "Skip playwright install if cache is hit. Use this for jobs that only need to check that cache exists."
6+
required: false
7+
default: "false"
38
runs:
49
using: "composite"
510
steps:
611
- name: Get installed Playwright version
712
shell: bash
813
id: playwright-version
914
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
15+
16+
# When skip-install-if-cache-hit is true, first check if cache exists without downloading (lookup-only mode)
17+
- name: Check playwright cache (lookup-only)
18+
if: ${{ inputs.skip-install-if-cache-hit == 'true' }}
19+
id: playwright-cache-check
20+
uses: actions/cache/restore@v4
21+
with:
22+
path: |
23+
~/Library/Caches/ms-playwright
24+
~/.cache/ms-playwright
25+
${{ github.workspace }}/node_modules/playwright
26+
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
27+
lookup-only: true
28+
29+
# Only restore cache if not in skip mode, or if skip mode but cache check missed
1030
- name: Cache playwright binaries
31+
if: ${{ inputs.skip-install-if-cache-hit != 'true' || steps.playwright-cache-check.outputs.cache-hit != 'true' }}
1132
id: playwright-cache
12-
uses: buildjet/cache@v4
33+
uses: actions/cache@v4
1334
with:
1435
path: |
1536
~/Library/Caches/ms-playwright
1637
~/.cache/ms-playwright
1738
${{ github.workspace }}/node_modules/playwright
1839
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
40+
41+
# In default mode: run if playwright-cache missed
42+
# In skip mode: run if playwright-cache-check missed (but cache restore step was also skipped)
1943
- name: Yarn playwright install
20-
if: steps.playwright-cache.outputs.cache-hit != 'true'
44+
if: ${{ (inputs.skip-install-if-cache-hit != 'true' && steps.playwright-cache.outputs.cache-hit != 'true') || (inputs.skip-install-if-cache-hit == 'true' && steps.playwright-cache-check.outputs.cache-hit != 'true') }}
2145
shell: bash
2246
run: yarn playwright install --with-deps

.github/workflows/all-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
required:
8383
needs: [lint, type-check, unit-test, api-v2-unit-test, integration-test, build, build-api-v1, build-api-v2, e2e, e2e-embed, e2e-embed-react, e2e-app-store]
8484
if: always()
85-
runs-on: buildjet-2vcpu-ubuntu-2204
85+
runs-on: blacksmith-2vcpu-ubuntu-2404
8686
steps:
8787
- name: fail if conditional jobs failed
8888
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')

0 commit comments

Comments
 (0)