Skip to content

Commit 38efed4

Browse files
authored
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
1 parent 91af737 commit 38efed4

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed

.github/workflows/all-checks.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
uses: ./.github/workflows/unit-tests.yml
2525
secrets: inherit
2626

27+
api-v2-unit-test:
28+
name: Tests
29+
uses: ./.github/workflows/api-v2-unit-tests.yml
30+
secrets: inherit
31+
2732
build-api-v1:
2833
name: Production builds
2934
uses: ./.github/workflows/api-v1-production-build.yml
@@ -75,7 +80,7 @@ jobs:
7580
secrets: inherit
7681

7782
required:
78-
needs: [lint, type-check, unit-test, integration-test, build, build-api-v1, build-api-v2, e2e, e2e-embed, e2e-embed-react, e2e-app-store]
83+
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]
7984
if: always()
8085
runs-on: buildjet-2vcpu-ubuntu-2204
8186
steps:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: API v2 Unit
2+
on:
3+
workflow_call:
4+
env:
5+
LINGO_DOT_DEV_API_KEY: ${{ secrets.CI_LINGO_DOT_DEV_API_KEY }}
6+
permissions:
7+
contents: read
8+
jobs:
9+
test:
10+
name: API v2 Unit
11+
timeout-minutes: 20
12+
runs-on: buildjet-4vcpu-ubuntu-2204
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: ./.github/actions/dangerous-git-checkout
16+
- uses: ./.github/actions/yarn-install
17+
- name: Run API v2 unit tests
18+
working-directory: apps/api/v2
19+
run: |
20+
export NODE_OPTIONS="--max_old_space_size=8192"
21+
yarn workspace @calcom/platform-libraries build && yarn test

.github/workflows/pr.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
branches:
77
- main
88
- gh-actions-test-branch
9+
910
workflow_dispatch:
1011

1112
permissions:
@@ -139,6 +140,13 @@ jobs:
139140
uses: ./.github/workflows/unit-tests.yml
140141
secrets: inherit
141142

143+
api-v2-unit-test:
144+
name: Tests
145+
needs: [prepare, deps]
146+
if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }}
147+
uses: ./.github/workflows/api-v2-unit-tests.yml
148+
secrets: inherit
149+
142150
setup-db:
143151
name: Setup Database
144152
needs: [prepare, deps]
@@ -252,6 +260,7 @@ jobs:
252260
lint,
253261
type-check,
254262
unit-test,
263+
api-v2-unit-test,
255264
check-api-v2-breaking-changes,
256265
integration-test,
257266
build,
@@ -276,10 +285,11 @@ jobs:
276285
(
277286
needs.prepare.outputs.has-files-requiring-all-checks == 'true' &&
278287
(
279-
needs.lint.result != 'success' ||
280-
needs.type-check.result != 'success' ||
281-
needs.unit-test.result != 'success' ||
282-
needs.check-api-v2-breaking-changes.result != 'success' ||
288+
needs.lint.result != 'success' ||
289+
needs.type-check.result != 'success' ||
290+
needs.unit-test.result != 'success' ||
291+
needs.api-v2-unit-test.result != 'success' ||
292+
needs.check-api-v2-breaking-changes.result != 'success' ||
283293
needs.build.result != 'success' ||
284294
needs.build-api-v1.result != 'success' ||
285295
needs.build-api-v2.result != 'success' ||

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@ jobs:
1717
- run: yarn test -- --no-isolate
1818
# We could add different timezones here that we need to run our tests in
1919
- run: TZ=America/Los_Angeles yarn test -- --timeZoneDependentTestsOnly --no-isolate
20-
- name: Run API v2 tests
21-
working-directory: apps/api/v2
22-
run: |
23-
export NODE_OPTIONS="--max_old_space_size=8192"
24-
yarn workspace @calcom/platform-libraries build && yarn test

0 commit comments

Comments
 (0)