Skip to content

Scheduling infrastructure for absolutely everyone.

ci: create new workflow for API v2 unit tests (#26189)

Anik Dhabal Babu38efed4f563a
diff --git a/.github/workflows/all-checks.yml b/.github/workflows/all-checks.yml
index 8d033f754c6..d7ca2ce7a08 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 00000000000..e1b01077fbd
--- /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 ba46275dfe5..03bda287f0c 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 b99326afe59..aa5cbb0e546 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