From 38efed4f563a0cad362a595ae2f5f809c312fbf0 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Fri, 26 Dec 2025 19:38:32 +0530 Subject: [PATCH] ci: create new workflow for API v2 unit tests (#26189) * playwright * Remove copy-app-store-static from web server command * check * test * api v2 unit test --- .github/workflows/all-checks.yml | 7 ++++++- .github/workflows/api-v2-unit-tests.yml | 21 +++++++++++++++++++++ .github/workflows/pr.yml | 18 ++++++++++++++---- .github/workflows/unit-tests.yml | 5 ----- 4 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/api-v2-unit-tests.yml diff --git a/.github/workflows/all-checks.yml b/.github/workflows/all-checks.yml index 8d033f754c..d7ca2ce7a0 100644 --- a/.github/workflows/all-checks.yml +++ b/.github/workflows/all-checks.yml @@ -24,6 +24,11 @@ jobs: uses: ./.github/workflows/unit-tests.yml secrets: inherit + api-v2-unit-test: + name: Tests + uses: ./.github/workflows/api-v2-unit-tests.yml + secrets: inherit + build-api-v1: name: Production builds uses: ./.github/workflows/api-v1-production-build.yml @@ -75,7 +80,7 @@ jobs: secrets: inherit required: - needs: [lint, type-check, unit-test, integration-test, build, build-api-v1, build-api-v2, e2e, e2e-embed, e2e-embed-react, e2e-app-store] + needs: [lint, type-check, unit-test, api-v2-unit-test, integration-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: diff --git a/.github/workflows/api-v2-unit-tests.yml b/.github/workflows/api-v2-unit-tests.yml new file mode 100644 index 0000000000..e1b01077fb --- /dev/null +++ b/.github/workflows/api-v2-unit-tests.yml @@ -0,0 +1,21 @@ +name: API v2 Unit +on: + workflow_call: +env: + LINGO_DOT_DEV_API_KEY: ${{ secrets.CI_LINGO_DOT_DEV_API_KEY }} +permissions: + contents: read +jobs: + test: + name: API v2 Unit + timeout-minutes: 20 + runs-on: buildjet-4vcpu-ubuntu-2204 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/dangerous-git-checkout + - uses: ./.github/actions/yarn-install + - 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 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ba46275dfe..03bda287f0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,6 +6,7 @@ on: branches: - main - gh-actions-test-branch + workflow_dispatch: permissions: @@ -139,6 +140,13 @@ jobs: uses: ./.github/workflows/unit-tests.yml secrets: inherit + api-v2-unit-test: + name: Tests + needs: [prepare, deps] + if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} + uses: ./.github/workflows/api-v2-unit-tests.yml + secrets: inherit + setup-db: name: Setup Database needs: [prepare, deps] @@ -252,6 +260,7 @@ jobs: lint, type-check, unit-test, + api-v2-unit-test, check-api-v2-breaking-changes, integration-test, build, @@ -276,10 +285,11 @@ jobs: ( needs.prepare.outputs.has-files-requiring-all-checks == 'true' && ( - needs.lint.result != 'success' || - needs.type-check.result != 'success' || - needs.unit-test.result != 'success' || - needs.check-api-v2-breaking-changes.result != 'success' || + needs.lint.result != 'success' || + needs.type-check.result != 'success' || + needs.unit-test.result != 'success' || + needs.api-v2-unit-test.result != 'success' || + needs.check-api-v2-breaking-changes.result != 'success' || needs.build.result != 'success' || needs.build-api-v1.result != 'success' || needs.build-api-v2.result != 'success' || diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b99326afe5..aa5cbb0e54 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -17,8 +17,3 @@ jobs: - run: yarn test -- --no-isolate # We could add different timezones here that we need to run our tests in - run: TZ=America/Los_Angeles yarn test -- --timeZoneDependentTestsOnly --no-isolate - - name: Run API v2 tests - working-directory: apps/api/v2 - run: | - export NODE_OPTIONS="--max_old_space_size=8192" - yarn workspace @calcom/platform-libraries build && yarn test