Skip to content

Commit d19eaae

Browse files
zomarsesau-moraisUdit-takkarCarinaWollihariombalhara
authored
Solves Github actions caching issues (#7431)
* Create env file workflow * Add env-cache * Fix env setter * Fix * Another fix * Fix * Fix * Fixes * FFS * Fix * Fix * Fix * Fix * Fix * Cache fixes * Fixes * Adds skipping steps * db-cache fixes * Test * Cache fixes * e2e * Possible caching conflicts * Running out of ideas * Caching is hard * One more time * cache-build not skipping * Fingers crossed * a * Test * Pls * Please * LFG * Build fix * fix * Whitespace!! * Zomars/cal 884 paid events not sending the link (#7318) * WIP * Sends correct emails for paid bookings * Update PaymentService.ts * Update webhook.ts * Update webhook.ts * Update settings back button redirect link (#7403) * fix(schedule): close on click #7143 * fix(EventSetupTab): validLocations length will always match validLocations length #7138 * fix(SettingsLayout): go back to right route #7379 * feat: get country code from ip geolocation (#6880) * feat: get coutnry code from ip geolocation Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * fix: create new api route for fetching code Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * chore: replace city with country Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * refactor: create hook for country Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> --------- Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * Team Workflows (#7038) Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> * Add destination calendar name to DestinationCalendarSelector (#6701) * Add destination calendar name * Type fix * Search through calendars only for destination calendar credential * Refactor get connected calendars * Clean up --------- Co-authored-by: zomars <zomars@me.com> * Update viewer.tsx (#7428) * Fix - add team members to emails (#7207) * On booking add team members & translation * Add team members to round robin create * Only update calendars on reschedule if there is a calendar reference * Send email on reschedules * Send team email on cancelled event * Add team members to calendar event description * Clean up * Convert other emails to organizer & teams * Type check fixes * More type fixes * Change organizer scheduled input to an object * early return updateCalendarEvent * Introduce team member type * Fix type errors * Put team members before attendees * Remove lodash cloneDeep * Update packages/core/EventManager.ts Co-authored-by: Omar López <zomars@me.com> * Remove booking select object * Revert "Remove booking select object" This reverts commit 9f121ff. * Refactor email manager (#7270) Co-authored-by: zomars <zomars@me.com> * Type change * Remove conditional check for updateAllCalendarEvents --------- Co-authored-by: zomars <zomars@me.com> * Typefix * Updates webhook response * Update pr.yml --------- Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> Co-authored-by: Esaú Morais <55207584+esau-morais@users.noreply.github.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
1 parent 4eecd42 commit d19eaae

File tree

12 files changed

+120
-301
lines changed

12 files changed

+120
-301
lines changed
+13-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
name: Cache production build binaries
22
description: "Cache or restore if necessary"
3-
env:
4-
node_version: v16.x
3+
inputs:
4+
node_version:
5+
required: false
6+
default: v16.x
57
runs:
68
using: "composite"
79
steps:
810
- name: Cache production build
911
uses: actions/cache@v3
12+
id: cache-build
1013
env:
1114
cache-name: prod-build
12-
key-1: ${{ env.node_version }}-${{ hashFiles('yarn.lock') }}
13-
key-2: ${{ hashFiles('apps/web/next.config.js') }}
14-
key-3: ${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
15+
key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }}
16+
key-2: ${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
17+
key-3: ${{ github.event.pull_request.number || github.ref }}
1518
with:
1619
path: |
17-
${{ github.workspace }}/apps/web/.next/cache
20+
${{ github.workspace }}/apps/web/.next
1821
**/.turbo/**
1922
**/dist/**
20-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ github.sha }}
21-
restore-keys: |
22-
${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-
23+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}
24+
- run: yarn build
25+
if: steps.cache-build.outputs.cache-hit != 'true'
26+
shell: bash

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

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Cache database between jobs
22
description: "Cache or restore if necessary"
33
inputs:
44
DATABASE_URL:
5-
required: true
5+
required: false
6+
default: "postgresql://postgres:@localhost:5432/calendso"
67
path:
78
required: false
89
default: "backups/backup.sql"
@@ -14,11 +15,15 @@ runs:
1415
uses: actions/cache@v3
1516
env:
1617
cache-name: cache-db
18+
key-1: ${{ hashFiles('packages/prisma/schema.prisma','packages/prisma/migrations/**.sql','packages/prisma/*.ts') }}
1719
with:
1820
path: ${{ inputs.path }}
19-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ github.sha }}
20-
restore-keys: |
21-
${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ github.sha }}
21+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ env.key-1 }}-${{ github.sha }}
22+
restore-keys: |
23+
${{ runner.os }}-${{ env.cache-name }}-${{ inputs.path }}-${{ env.key-1 }}-${{ github.sha }}
24+
- run: yarn db-seed
25+
if: steps.cache-db.outputs.cache-hit != 'true'
26+
shell: bash
2227
- name: Postgres Dump Backup
2328
if: steps.cache-db.outputs.cache-hit != 'true'
2429
uses: tj-actions/pg-dump@v2.3
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Set environment variables"
2+
description: "Configures environment variables for a workflow"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Create env file
7+
uses: actions/cache@v3
8+
id: env-cache
9+
with:
10+
path: gh.env
11+
key: env-cache-${{ hashFiles('gh.env') }}
12+
restore-keys: env-cache-
13+
- name: Set Environment Variables
14+
if: steps.env-cache.outputs.cache-hit == 'true'
15+
uses: tw3lveparsecs/github-actions-setvars@latest
16+
with:
17+
envFilePath: gh.env
18+
- name: Set Environment Variables
19+
if: steps.env-cache.outputs.cache-hit != 'true'
20+
shell: bash
21+
run: |
22+
echo "You need to run env-create-file first"
23+
exit 1

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

-105
This file was deleted.

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

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
name: Yarn install
22
description: "Install all NPM dependencies, caches them and restores if necessary"
3-
env:
4-
node_version: v16.x
3+
inputs:
4+
node_version:
5+
required: false
6+
default: v16.x
57
runs:
68
using: "composite"
79
steps:
8-
- name: Use Node ${{ env.node_version }}
10+
- name: Use Node ${{ inputs.node_version }}
911
uses: actions/setup-node@v3
1012
with:
11-
node-version: ${{ env.node_version }}
13+
node-version: ${{ inputs.node_version }}
1214
cache: "yarn"
1315
- name: node_modules cache
1416
id: node-modules-cache
1517
uses: actions/cache@v3
1618
env:
1719
cache-name: node-modules-yarn
18-
cache-key: ${{ env.node_version }}-${{ hashFiles('yarn.lock', 'packages/prisma/schema.prisma') }}
20+
cache-key: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock', 'packages/prisma/schema.prisma') }}
1921
with:
2022
path: |
2123
**/node_modules/**

.github/workflows/e2e-app-store.yml

+1-33
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,6 @@ jobs:
77
timeout-minutes: 20
88
name: E2E App-Store Apps
99
runs-on: ubuntu-latest
10-
11-
env:
12-
DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
13-
NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
14-
NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
15-
NEXTAUTH_SECRET: secret
16-
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
17-
GOOGLE_LOGIN_ENABLED: true
18-
# CRON_API_KEY: xxx
19-
CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
20-
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
21-
STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
22-
STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
23-
STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
24-
PAYMENT_FEE_PERCENTAGE: 0.005
25-
PAYMENT_FEE_FIXED: 10
26-
SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
27-
SAML_ADMINS: pro@example.com
28-
NEXTAUTH_URL: http://localhost:3000/api/auth
29-
NEXT_PUBLIC_IS_E2E: 1
30-
# EMAIL_FROM: e2e@cal.com
31-
# EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
32-
# EMAIL_SERVER_PORT: ${{ secrets.CI_EMAIL_SERVER_PORT }}
33-
# EMAIL_SERVER_USER: ${{ secrets.CI_EMAIL_SERVER_USER }}
34-
# EMAIL_SERVER_PASSWORD: ${{ secrets.CI_EMAIL_SERVER_PASSWORD }}
35-
# MS_GRAPH_CLIENT_ID: xxx
36-
# MS_GRAPH_CLIENT_SECRET: xxx
37-
# ZOOM_CLIENT_ID: xxx
38-
# ZOOM_CLIENT_SECRET: xxx
39-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
40-
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
4110
services:
4211
postgres:
4312
image: postgres:12.1
@@ -54,8 +23,7 @@ jobs:
5423
- uses: ./.github/actions/yarn-install
5524
- uses: ./.github/actions/yarn-playwright-install
5625
- uses: ./.github/actions/cache-db
57-
with:
58-
DATABASE_URL: ${{ env.DATABASE_URL }}
26+
- uses: ./.github/actions/env-read-file
5927
- uses: ./.github/actions/cache-build
6028
- name: Run Tests
6129
run: yarn test-e2e:app-store

.github/workflows/e2e-embed.yml

+1-37
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,6 @@ jobs:
66
e2e-embed:
77
timeout-minutes: 20
88
runs-on: ubuntu-latest
9-
env:
10-
DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
11-
NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
12-
NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
13-
NEXTAUTH_SECRET: secret
14-
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
15-
GOOGLE_LOGIN_ENABLED: true
16-
# CRON_API_KEY: xxx
17-
CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
18-
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
19-
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE }}
20-
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE }}
21-
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE }}
22-
NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE: ${{ secrets.NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE }}
23-
NEXT_PUBLIC_IS_PREMIUM_NEW_PLAN: 1
24-
STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
25-
STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
26-
STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
27-
PAYMENT_FEE_PERCENTAGE: 0.005
28-
PAYMENT_FEE_FIXED: 10
29-
SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
30-
SAML_ADMINS: pro@example.com
31-
NEXTAUTH_URL: http://localhost:3000/api/auth
32-
NEXT_PUBLIC_IS_E2E: 1
33-
# EMAIL_FROM: e2e@cal.com
34-
# EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
35-
# EMAIL_SERVER_PORT: ${{ secrets.CI_EMAIL_SERVER_PORT }}
36-
# EMAIL_SERVER_USER: ${{ secrets.CI_EMAIL_SERVER_USER }}
37-
# EMAIL_SERVER_PASSWORD: ${{ secrets.CI_EMAIL_SERVER_PASSWORD }}
38-
# MS_GRAPH_CLIENT_ID: xxx
39-
# MS_GRAPH_CLIENT_SECRET: xxx
40-
# ZOOM_CLIENT_ID: xxx
41-
# ZOOM_CLIENT_SECRET: xxx
42-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
43-
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
449
services:
4510
postgres:
4611
image: postgres:12.1
@@ -57,8 +22,7 @@ jobs:
5722
- uses: ./.github/actions/yarn-install
5823
- uses: ./.github/actions/yarn-playwright-install
5924
- uses: ./.github/actions/cache-db
60-
with:
61-
DATABASE_URL: ${{ env.DATABASE_URL }}
25+
- uses: ./.github/actions/env-read-file
6226
- uses: ./.github/actions/cache-build
6327
- name: Run Tests
6428
run: yarn turbo run embed-tests-update-snapshots:ci --scope=@calcom/embed-react --concurrency=1

.github/workflows/e2e.yml

+6-45
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,8 @@ on:
44
jobs:
55
e2e:
66
timeout-minutes: 20
7-
runs-on: buildjet-4vcpu-ubuntu-2204
8-
env:
9-
DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
10-
NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
11-
NEXT_PUBLIC_WEBSITE_URL: http://localhost:3000
12-
NEXTAUTH_SECRET: secret
13-
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
14-
GOOGLE_LOGIN_ENABLED: true
15-
# CRON_API_KEY: xxx
16-
CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
17-
DAILY_API_KEY: ${{ secrets.CI_DAILY_API_KEY }}
18-
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
19-
NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE }}
20-
NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE }}
21-
NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE }}
22-
NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE: ${{ secrets.NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE }}
23-
NEXT_PUBLIC_IS_PREMIUM_NEW_PLAN: 1
24-
STRIPE_PRIVATE_KEY: ${{ secrets.CI_STRIPE_PRIVATE_KEY }}
25-
STRIPE_CLIENT_ID: ${{ secrets.CI_STRIPE_CLIENT_ID }}
26-
STRIPE_WEBHOOK_SECRET: ${{ secrets.CI_STRIPE_WEBHOOK_SECRET }}
27-
STRIPE_PRO_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_PRO_PLAN_PRODUCT_ID }}
28-
STRIPE_PREMIUM_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_PREMIUM_PLAN_PRODUCT_ID }}
29-
STRIPE_FREE_PLAN_PRODUCT_ID: ${{ secrets.CI_STRIPE_FREE_PLAN_PRODUCT_ID }}
30-
PAYMENT_FEE_PERCENTAGE: 0.005
31-
PAYMENT_FEE_FIXED: 10
32-
SAML_DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
33-
SAML_ADMINS: pro@example.com
34-
NEXTAUTH_URL: http://localhost:3000/api/auth
35-
NEXT_PUBLIC_IS_E2E: 1
36-
# EMAIL_FROM: e2e@cal.com
37-
# EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
38-
# EMAIL_SERVER_PORT: ${{ secrets.CI_EMAIL_SERVER_PORT }}
39-
# EMAIL_SERVER_USER: ${{ secrets.CI_EMAIL_SERVER_USER }}
40-
# EMAIL_SERVER_PASSWORD: ${{ secrets.CI_EMAIL_SERVER_PASSWORD }}
41-
# MS_GRAPH_CLIENT_ID: xxx
42-
# MS_GRAPH_CLIENT_SECRET: xxx
43-
# ZOOM_CLIENT_ID: xxx
44-
# ZOOM_CLIENT_SECRET: xxx
45-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
46-
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
7+
name: E2E tests
8+
runs-on: ubuntu-latest
479
services:
4810
postgres:
4911
image: postgres:12.1
@@ -52,19 +14,18 @@ jobs:
5214
POSTGRES_DB: calendso
5315
ports:
5416
- 5432:5432
55-
5617
steps:
5718
- uses: actions/checkout@v3
5819
- uses: ./.github/actions/dangerous-git-checkout
5920
- run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV
6021
- uses: ./.github/actions/yarn-install
6122
- uses: ./.github/actions/yarn-playwright-install
6223
- uses: ./.github/actions/cache-db
63-
with:
64-
DATABASE_URL: ${{ env.DATABASE_URL }}
24+
- uses: ./.github/actions/env-read-file
6525
- uses: ./.github/actions/cache-build
66-
- run: yarn test-e2e
67-
- name: Upload test results
26+
- name: Run Tests
27+
run: yarn test-e2e
28+
- name: Upload Test Results
6829
if: ${{ always() }}
6930
uses: actions/upload-artifact@v2
7031
with:

0 commit comments

Comments
 (0)