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
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
@@ -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' ||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user