Skip to content
Open
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
40 changes: 40 additions & 0 deletions .github/actions/cache-checkout/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Cache Git Checkout
description: "Save or restore git checkout from cache to speed up CI workflows"
inputs:
mode:
description: "Mode of operation: 'save' to cache the checkout, 'restore' to restore from cache"
required: true

runs:
using: "composite"
steps:
- name: Restore git checkout from cache
if: ${{ inputs.mode == 'restore' }}
uses: actions/cache/restore@v4
id: cache-restore
with:
path: |
.
!.git
!node_modules
!**/node_modules
key: git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Delete previous git-checkout caches for this branch
if: ${{ inputs.mode == 'save' }}
uses: useblacksmith/cache-delete@v1
with:
key: git-checkout-${{ github.head_ref || github.ref_name }}-
prefix: "true"

- name: Save git checkout to cache
if: ${{ inputs.mode == 'save' }}
uses: actions/cache/save@v4
with:
path: |
.
!.git
!node_modules
!**/node_modules
key: git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
5 changes: 5 additions & 0 deletions .github/actions/dangerous-git-checkout/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ runs:
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/example-apps/
!**/*.mp4
6 changes: 5 additions & 1 deletion .github/workflows/api-v1-production-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ jobs:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/cache-db
- name: Cache API v1 production build
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/api-v2-production-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- name: Generate Prisma schemas
working-directory: apps/api/v2
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/api-v2-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- run: yarn prisma generate
- name: Run API v2 unit tests
working-directory: apps/api/v2
run: |
export NODE_OPTIONS="--max_old_space_size=8192"
yarn workspace @calcom/platform-libraries build && yarn test
TZ=America/New_York yarn workspace @calcom/platform-libraries build && yarn test
6 changes: 5 additions & 1 deletion .github/workflows/atoms-production-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- name: Cache atoms production build
uses: actions/cache@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/check-api-v2-breaking-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install

- name: Generate Swagger
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/check-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- name: Show info
run: node -e "console.log(require('v8').getHeapStatistics())"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/companion-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore

- name: Setup Bun
uses: oven-sh/setup-bun@v1
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/delete-blacksmith-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ jobs:
with:
key: ${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.ref }}
prefix: "true"

delete-git-checkout-cache-on-pr-close:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Delete git-checkout cache
uses: useblacksmith/cache-delete@v1
with:
key: git-checkout-${{ github.event.pull_request.head.ref }}-
prefix: "true"
6 changes: 5 additions & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- name: Cache Docs build
uses: actions/cache@v4
id: cache-docs-build
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e-api-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/cache-db
- name: Build platform packages with Turbo
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e-app-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- run: yarn prisma generate
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e-embed-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- run: yarn prisma generate
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- run: yarn prisma generate
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/yarn-playwright-install
- run: yarn prisma generate
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- run: yarn prisma generate
- uses: ./.github/actions/cache-db
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- name: Run Lint
run: yarn lint
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- name: Cache git checkout
uses: ./.github/actions/cache-checkout
with:
mode: save
- name: Generate DB cache key
id: cache-db-key
uses: ./.github/actions/cache-db-key
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/production-build-without-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- run: yarn prisma generate
- name: Generate cache key
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/setup-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ jobs:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
if: inputs.DB_CACHE_HIT != 'true'
- run: yarn prisma generate
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
with:
sparse-checkout: .github
- uses: ./.github/actions/cache-checkout
with:
mode: restore
- uses: ./.github/actions/yarn-install
- run: yarn prisma generate
- run: yarn test -- --no-isolate
Expand Down
Loading
Loading