Files
calendar/.github/workflows/api-v2-production-build.yml
T
4a88051531 chore: Only run E2E suite when ready-for-e2e label added (#15529)
* chore: Improve CI workflow

* Made a new pre-merge flow that runs the builds and e2e

* Refactored back into 1 file

* Adding another condition for checking the ready-for-e2e

* syntax

* More syntax

* Change e2e-required to only run when ready so it doesn't fail

* A different attempt at getting the ready-for-e2e label

* Supporting PRs and workflow_dispatch

* logging the branch

* hardcoding to test

* Trying the rest call

* Added logging

* Check for the label in the same step

* More logging

* Added job-level output

* Reverted back to 'true'

* Moved the e2e required check into the main required check

* More logging

* Peeling the branch off of the ref

* Fix the ref

* Trying a separate workflow for labeling

* Updated name for the labeled file

* Checking label events to avoid unnecessary runs

* Got rid of the extra check to see if required should run

* Upgraded old actions running Node 16

* Updated the pre-reqs for running jobs

* Removed the dependency of API builds before starting E2E suites

* Removed extra production build used by analyze job

* Fixed the run-e2e check

* Using the pull request object when available

* Checking for null PR

* Added check for no event

---------

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
2024-06-22 00:52:27 +00:00

61 lines
1.9 KiB
YAML

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@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- name: Cache API v2 production build
uses: buildjet/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 }}
- run: |
export NODE_OPTIONS="--max_old_space_size=8192"
if [ ${{ steps.cache-api-v2-build.outputs.cache-hit }} == 'true' ]; then
echo "Cache hit for API v2 build. Skipping build."
else
yarn workspace @calcom/api-v2 run generate-schemas
rm -rf apps/api/v2/node_modules
yarn install
yarn workspace @calcom/api-v2 run build
fi
shell: bash