Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .github/actions/cache-db-key/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Generate cache-db key
description: "Generate the cache key for database caching"
inputs:
path:
required: false
default: "backups/backup.sql"
description: "Path to the backup file"
outputs:
key:
description: "The generated cache key"
value: ${{ steps.generate-key.outputs.key }}
runs:
using: "composite"
steps:
- name: Generate cache key
id: generate-key
shell: bash
env:
CACHE_NAME: cache-db
PATH_KEY: ${{ inputs.path }}
PRISMA_HASH: ${{ hashFiles('packages/prisma/schema.prisma', 'packages/prisma/migrations/**/**.sql', 'packages/prisma/*.ts') }}
run: |
echo "key=${CACHE_NAME}-${PATH_KEY}-${PRISMA_HASH}" >> $GITHUB_OUTPUT
15 changes: 6 additions & 9 deletions .github/actions/cache-db/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,26 @@ inputs:
path:
required: false
default: "backups/backup.sql"
COMMIT_SHA:
required: false
default: ""
description: "Commit SHA to include in cache key (passed from workflow)"
runs:
using: "composite"
steps:
- name: Generate cache key
id: cache-key
uses: ./.github/actions/cache-db-key
with:
path: ${{ inputs.path }}
- name: Cache database
id: cache-db
uses: actions/cache@v4
env:
cache-name: cache-db
key-1: ${{ hashFiles('packages/prisma/schema.prisma', 'packages/prisma/migrations/**/**.sql', 'packages/prisma/*.ts') }}
key-2: ${{ github.event.pull_request.number || github.ref }}
key-3: ${{ inputs.COMMIT_SHA || github.event.pull_request.head.sha || github.sha }}
DATABASE_URL: ${{ inputs.DATABASE_URL }}
DATABASE_DIRECT_URL: ${{ inputs.DATABASE_URL }}
E2E_TEST_CALCOM_QA_EMAIL: ${{ inputs.E2E_TEST_CALCOM_QA_EMAIL }}
E2E_TEST_CALCOM_QA_PASSWORD: ${{ inputs.E2E_TEST_CALCOM_QA_PASSWORD }}
E2E_TEST_CALCOM_QA_GCAL_CREDENTIALS: ${{ inputs.E2E_TEST_CALCOM_QA_GCAL_CREDENTIALS }}
with:
path: ${{ inputs.path }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}
key: ${{ steps.cache-key.outputs.key }}
- run: yarn db-seed
if: steps.cache-db.outputs.cache-hit != 'true'
shell: bash
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/api-v1-production-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calendso
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd "pg_isready -h 127.0.0.1 -U postgres"
--health-interval 2s
--health-timeout 3s
--health-retries 15
--health-start-period 2s
ports:
- 5432:5432
steps:
Expand Down
30 changes: 7 additions & 23 deletions .github/workflows/api-v2-production-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
env:
DATABASE_URL: ${{ secrets.CI_DATABASE_URL }}
DATABASE_DIRECT_URL: ${{ secrets.CI_DATABASE_URL }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
build:
Expand Down Expand Up @@ -35,29 +37,11 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- name: Cache API v2 production build
uses: actions/cache@v4
id: cache-api-v2-build
env:
cache-name: api-v2-build
key-1: ${{ hashFiles('yarn.lock') }}
key-2: ${{ hashFiles('apps/api/v2/**.[jt]s', 'apps/api/v2/**.[jt]sx', '!**/node_modules') }}
key-3: ${{ github.event.pull_request.number || github.ref }}
# Ensures production-build.yml will always be fresh
key-4: ${{ github.sha }}
with:
path: |
**/dist/**
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ env.key-4 }}
- name: Log Cache Hit
if: steps.cache-api-v2-build.outputs.cache-hit == 'true'
run: echo "Cache hit for API v2 build. Skipping build."
- name: Run build
if: steps.cache-api-v2-build.outputs.cache-hit != 'true'
- name: Generate Prisma schemas
working-directory: apps/api/v2
run: yarn workspace @calcom/api-v2 run generate-schemas
- name: Build API v2 with Turbo
run: |
export NODE_OPTIONS="--max_old_space_size=8192"
yarn workspace @calcom/api-v2 run generate-schemas &&
rm -rf apps/api/v2/node_modules &&
yarn install &&
yarn workspace @calcom/api-v2 run build
yarn turbo run build --filter=@calcom/api-v2
shell: bash
24 changes: 18 additions & 6 deletions .github/workflows/e2e-api-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
VAPID_PRIVATE_KEY: ${{ secrets.VAPID_PRIVATE_KEY }}
JWT_SECRET: ${{ secrets.CI_JWT_SECRET }}
NODE_ENV: ${{ vars.CI_NODE_ENV }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
e2e:
timeout-minutes: 20
Expand All @@ -43,10 +45,11 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calendso
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd "pg_isready -h 127.0.0.1 -U postgres"
--health-interval 2s
--health-timeout 3s
--health-retries 15
--health-start-period 2s
ports:
- 5432:5432
redis:
Expand Down Expand Up @@ -74,13 +77,22 @@ jobs:
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/cache-db
- name: Build platform packages with Turbo
run: |
yarn turbo run build \
--filter=@calcom/platform-constants \
--filter=@calcom/platform-enums \
--filter=@calcom/platform-utils \
--filter=@calcom/platform-types \
--filter=@calcom/platform-libraries \
--filter=@calcom/trpc

- name: Run Tests
working-directory: apps/api/v2
run: |
yarn test:e2e --shard=${{ matrix.shard }}/${{ strategy.job-total }}
yarn test:e2e:ci --shard=${{ matrix.shard }}/${{ strategy.job-total }}
EXIT_CODE=$?
echo "yarn test:e2e --shard=${{ matrix.shard }}/${{ strategy.job-total }} command exit code: $EXIT_CODE"
echo "yarn test:e2e:ci --shard=${{ matrix.shard }}/${{ strategy.job-total }} command exit code: $EXIT_CODE"
exit $EXIT_CODE

- name: Upload Test Results
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/e2e-app-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calendso
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd "pg_isready -h 127.0.0.1 -U postgres"
--health-interval 2s
--health-timeout 3s
--health-retries 15
--health-start-period 2s
ports:
- 5432:5432
mailhog:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/e2e-embed-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calendso
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd "pg_isready -h 127.0.0.1 -U postgres"
--health-interval 2s
--health-timeout 3s
--health-retries 15
--health-start-period 2s
ports:
- 5432:5432
strategy:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/e2e-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calendso
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd "pg_isready -h 127.0.0.1 -U postgres"
--health-interval 2s
--health-timeout 3s
--health-retries 15
--health-start-period 2s
ports:
- 5432:5432
mailhog:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calendso
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd "pg_isready -h 127.0.0.1 -U postgres"
--health-interval 2s
--health-timeout 3s
--health-retries 15
--health-start-period 2s
ports:
- 5432:5432
mailhog:
Expand All @@ -74,7 +75,7 @@ jobs:
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
shard: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: docker/login-action@v3
with:
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,20 @@ jobs:
has_companion: ${{ steps.filter.outputs.has_companion }}
commit-sha: ${{ steps.get_sha.outputs.commit-sha }}
run-e2e: ${{ steps.check-if-pr-has-label.outputs.run-e2e == 'true' }}
db-cache-hit: ${{ steps.cache-db-check.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- name: Generate DB cache key
id: cache-db-key
uses: ./.github/actions/cache-db-key
- name: Check DB cache (lookup-only)
id: cache-db-check
uses: actions/cache/restore@v4
with:
path: backups/backup.sql
key: ${{ steps.cache-db-key.outputs.key }}
lookup-only: true
- uses: dorny/paths-filter@v3
id: filter
with:
Expand Down Expand Up @@ -288,7 +299,7 @@ jobs:
if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }}
uses: ./.github/workflows/setup-db.yml
with:
COMMIT_SHA: ${{ needs.prepare.outputs.commit-sha }}
DB_CACHE_HIT: ${{ needs.prepare.outputs.db-cache-hit }}
secrets: inherit

build-api-v1:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/setup-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Setup Database
on:
workflow_call:
inputs:
COMMIT_SHA:
DB_CACHE_HIT:
required: false
type: string
default: ""
description: "Commit SHA to include in cache key"
default: "false"
description: "Whether the DB cache was hit (skip yarn-install and cache-db if true)"

permissions:
contents: read
Expand Down Expand Up @@ -49,6 +49,6 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
if: inputs.DB_CACHE_HIT != 'true'
- uses: ./.github/actions/cache-db
with:
COMMIT_SHA: ${{ inputs.COMMIT_SHA || github.sha }}
if: inputs.DB_CACHE_HIT != 'true'
2 changes: 1 addition & 1 deletion apps/api/v1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@calcom/tsconfig": "workspace:*",
"@calcom/types": "workspace:*",
"node-mocks-http": "1.16.2",
"typescript": "5.9.2"
"typescript": "5.9.3"
},
"dependencies": {
"@calcom/app-store": "workspace:*",
Expand Down
11 changes: 9 additions & 2 deletions apps/api/v2/jest-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const getMaxWorkers = () => {
const maxWorkers = getMaxWorkers();

const config: Config = {
preset: "ts-jest",
moduleFileExtensions: ["js", "json", "ts"],
rootDir: ".",
moduleNameMapper: {
Expand All @@ -28,7 +27,15 @@ const config: Config = {
testEnvironment: "node",
testRegex: ".e2e-spec.ts$",
transform: {
"^.+\\.ts$": "ts-jest",
"^.+\\.ts$": [
"ts-jest",
process.env.CI
? {
isolatedModules: true,
diagnostics: false,
}
: {},
],
},
setupFiles: ["<rootDir>/test/setEnvVars.ts", "jest-date-mock"],
setupFilesAfterEnv: ["<rootDir>/test/jest.setup-e2e.ts"],
Expand Down
3 changes: 2 additions & 1 deletion apps/api/v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"test:cov": "yarn dev:build && jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "yarn dev:build && NODE_OPTIONS='--max_old_space_size=8192 --experimental-vm-modules' jest --ci --forceExit --config ./jest-e2e.ts",
"test:e2e:ci": "NODE_OPTIONS='--max_old_space_size=8192 --experimental-vm-modules' jest --ci --forceExit --config ./jest-e2e.ts",
"test:e2e:local": "yarn test:e2e --maxWorkers=4",
"test:e2e:watch": "yarn dev:build && jest --runInBand --detectOpenHandles --forceExit --config ./jest-e2e.ts --watch",
"prisma": "yarn workspace @calcom/prisma prisma",
Expand Down Expand Up @@ -109,7 +110,7 @@
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "5.9.2"
"typescript": "5.9.3"
},
"prisma": {
"schema": "../../../packages/prisma/schema.prisma"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { plainToClass } from "class-transformer";
import { Request } from "express";

import { SUCCESS_STATUS, X_CAL_CLIENT_ID } from "@calcom/platform-constants";
import { OrgTeamOutputDto, type SkipTakePagination } from "@calcom/platform-types";
import { OrgTeamOutputDto, SkipTakePagination } from "@calcom/platform-types";
import type { Team } from "@calcom/prisma/client";

@Controller({
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"tailwindcss": "4.1.17",
"ts-node": "10.9.2",
"turbo": "2.5.5",
"typescript": "5.9.2"
"typescript": "5.9.3"
},
"nextBundleAnalysis": {
"budget": 358400,
Expand Down
Loading
Loading