diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 459d5b7e51..c90accfbf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,7 @@ on: - "website/test/**" - "website/package.json" - "packages/simplex-chat-mcp/**" + - "apps/simplex-support-bot/**" types: [opened, synchronize, reopened, ready_for_review] workflow_dispatch: inputs: diff --git a/scripts/ci/README.md b/scripts/ci/README.md index c0986dbe33..0693d4e90d 100644 --- a/scripts/ci/README.md +++ b/scripts/ci/README.md @@ -146,6 +146,13 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve - before a publication: the package with its published dependencies, type-checked and unit tested in job `publish` of build.yml (docs/contributing/RELEASES.md, "MCP server release"). - Local: `scripts/ci/scope-tests.sh mcp`. +#### support-bot + +- Globs: apps/simplex-support-bot/**. +- CI, in build-linux: `scope-tests.sh support-bot` (step "Test changed scopes"): `npm ci`, `npm run build` and `npm test`, with the published `simplex-chat` and `@simplex-chat/types` of package-lock.json. +- The Docker image (scripts/support-bot/Dockerfile) is not built in CI. +- Local: `scripts/ci/scope-tests.sh support-bot`. + #### Scopes lacking CI tests | Scope | Paths | CI | @@ -155,7 +162,6 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve | ts-client | packages/simplex-chat-client/typescript/** | - | | webrtc | packages/simplex-chat-webrtc/** | - | | calculator-bot | apps/simplex-calculator-bot/** | - | -| support-bot | apps/simplex-support-bot/** | - | | support-bot-light | apps/simplex-support-bot-light/** | - | | prices | scripts/prices/** | - | | nft | eth/nft/** | - | diff --git a/scripts/ci/packages_release.py b/scripts/ci/packages_release.py index 842432daab..15c00501f7 100644 --- a/scripts/ci/packages_release.py +++ b/scripts/ci/packages_release.py @@ -90,6 +90,7 @@ SCOPE_CHANGES = { "packages/simplex-chat-nodejs/**", "packages/simplex-chat-client/types/typescript/**", ], + "support-bot": ["apps/simplex-support-bot/**"], } CABAL_FILE = "simplex-chat.cabal" CABAL_VERSION = re.compile(r"^(version:\s*)(\S+)", re.M) diff --git a/scripts/ci/scope-tests.sh b/scripts/ci/scope-tests.sh index 7d9108372d..74c04c2842 100755 --- a/scripts/ci/scope-tests.sh +++ b/scripts/ci/scope-tests.sh @@ -25,8 +25,11 @@ case "${1:-}" in npm test npm run test:e2e ;; + support-bot) + (cd apps/simplex-support-bot && npm ci --no-audit --no-fund && npm run build && npm test) + ;; *) - echo "usage: $0 badge-web | ci-scripts | website | mcp" >&2 + echo "usage: $0 badge-web | ci-scripts | website | mcp | support-bot" >&2 exit 1 ;; esac diff --git a/scripts/ci/test_packages_release.py b/scripts/ci/test_packages_release.py index 8c8a5c054a..e5bfac4823 100644 --- a/scripts/ci/test_packages_release.py +++ b/scripts/ci/test_packages_release.py @@ -527,6 +527,10 @@ class ChangesTest(GitRepoTest): self.assertEqual(self.builds("packages/simplex-chat-nodejs/src/api.ts"), {"packages"}) self.assertEqual(self.values["scopes"], "mcp") + def test_support_bot_change_tests_its_scope(self): + self.assertEqual(self.builds("apps/simplex-support-bot/src/bot.ts"), set()) + self.assertEqual(self.values["scopes"], "support-bot") + class PackageStateTest(GitRepoTest): def setUp(self):