diff --git a/.github/workflows/api-v1-production-build.yml b/.github/workflows/api-v1-production-build.yml index fc4a140578..b611219bf2 100644 --- a/.github/workflows/api-v1-production-build.yml +++ b/.github/workflows/api-v1-production-build.yml @@ -39,7 +39,7 @@ env: jobs: build: - name: Build API V1 + name: Build API v1 runs-on: buildjet-4vcpu-ubuntu-2204 timeout-minutes: 30 services: diff --git a/.github/workflows/api-v2-production-build.yml b/.github/workflows/api-v2-production-build.yml new file mode 100644 index 0000000000..31cb8a23e0 --- /dev/null +++ b/.github/workflows/api-v2-production-build.yml @@ -0,0 +1,42 @@ +name: Production Build + +on: + workflow_call: + +env: + DATABASE_URL: ${{ secrets.CI_DATABASE_URL }} + DATABASE_DIRECT_URL: ${{ secrets.CI_DATABASE_URL }} + +jobs: + build: + name: Build API v2 + runs-on: buildjet-4vcpu-ubuntu-2204 + timeout-minutes: 30 + services: + postgres: + image: postgres:13 + credentials: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: calendso + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/dangerous-git-checkout + - uses: ./.github/actions/yarn-install + - 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 + shell: bash diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9263005bac..1334dd69a4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -63,6 +63,13 @@ jobs: uses: ./.github/workflows/api-v1-production-build.yml secrets: inherit + build-api-v2: + name: Production build + needs: [changes] + if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }} + uses: ./.github/workflows/api-v2-production-build.yml + secrets: inherit + build-without-database: name: Production build (without database) needs: [changes] @@ -72,28 +79,28 @@ jobs: e2e: name: E2E tests - needs: [changes, lint, build] + needs: [changes, lint, build, build-api-v1, build-api-v2] if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/e2e.yml secrets: inherit e2e-app-store: name: E2E App Store tests - needs: [changes, lint, build] + needs: [changes, lint, build, build-api-v1, build-api-v2] if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/e2e-app-store.yml secrets: inherit e2e-embed: name: E2E embeds tests - needs: [changes, lint, build] + needs: [changes, lint, build, build-api-v1, build-api-v2] if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/e2e-embed.yml secrets: inherit e2e-embed-react: name: E2E React embeds tests - needs: [changes, lint, build] + needs: [changes, lint, build, build-api-v1, build-api-v2] if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/e2e-embed-react.yml secrets: inherit @@ -106,7 +113,7 @@ jobs: secrets: inherit required: - needs: [changes, lint, type-check, test, build, build-api-v1, e2e, e2e-embed, e2e-embed-react, e2e-app-store] + needs: [changes, lint, type-check, test, build, build-api-v1, build-api-v2, e2e, e2e-embed, e2e-embed-react, e2e-app-store] if: always() runs-on: buildjet-2vcpu-ubuntu-2204 steps: