mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-22 07:58:02 +00:00
Merge branch 'master' into names
This commit is contained in:
88 files changed
+12160
-195
No files matched your search
+8
-11
@@ -45,6 +45,7 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve
|
||||
- caches (the steps "Restore ... from cache");
|
||||
- `cabal build -j --enable-tests --ghc-options=-O0` (step "Build CLI");
|
||||
- simplex-chat-test with the selected tests (step "Run tests"), each attempt limited to 35 minutes by `timeout`; an attempt that reaches the limit fails, and "Attempt <n> timed out." is printed.
|
||||
- App test fixtures: core tests write the core's responses and events that the app tests use to tests/fixtures/api (`/names tests/` to tests/fixtures/api/names, `/contact via address/` to tests/fixtures/api/connect, `/updated item event has the previous item/`, `/should send updated item with mentions added and removed by edit/` and `/mark call invitation missed when the caller ends the call/` to tests/fixtures/api/updates), and fail when a recording differs from the committed file; the rewritten files are committed, and the kotlin and ios scopes run for them.
|
||||
- Local:
|
||||
```sh
|
||||
cp scripts/cabal.project.local.linux cabal.project.local
|
||||
@@ -73,9 +74,10 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve
|
||||
|
||||
- Globs:
|
||||
- apps/ios/**
|
||||
- tests/fixtures/api/**
|
||||
- scripts/ci/ios-stub-libs.sh
|
||||
- CI: build-ios: stub libraries, then xcodebuild for the iOS Simulator without signing.
|
||||
- Local, on macOS: `scripts/ci/ios-stub-libs.sh`, then the xcodebuild command of the step "Build iOS app" of build-ios.
|
||||
- CI: build-ios: stub libraries, then xcodebuild for the iOS Simulator without signing (step "Build iOS app"), then the target SimpleX Unit Tests, hosted by the app, in a new simulator (step "Run iOS unit tests"). The stubs of `chat_migrate_init` and `chat_migrate_init_key` return an empty string, so the app opens its database error screen and calls the core no more.
|
||||
- Local, on macOS: `scripts/ci/ios-stub-libs.sh`, then the commands of the steps "Build iOS app" and "Run iOS unit tests" of build-ios.
|
||||
|
||||
#### packages
|
||||
|
||||
@@ -143,17 +145,13 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve
|
||||
|
||||
#### mcp
|
||||
|
||||
- Globs:
|
||||
- packages/simplex-chat-mcp/**
|
||||
- packages/simplex-chat-nodejs/**
|
||||
- packages/simplex-chat-client/types/typescript/**
|
||||
- Globs: packages/simplex-chat-mcp/**.
|
||||
- CI:
|
||||
- in build-linux: `scope-tests.sh mcp` (step "Test changed scopes"):
|
||||
- the types package and the Node.js library built from the branch without the add-on, as package-tests.sh builds them;
|
||||
- `npm ci`, then both installed into the MCP package with `npm install --no-save`;
|
||||
- in build-linux: `scope-tests.sh mcp` (step "Test changed scopes"), with the published `simplex-chat` and `@simplex-chat/types` of package-lock.json:
|
||||
- `npm ci`;
|
||||
- `npx tsc` and `npx tsc -p test/tsconfig.json --noEmit`;
|
||||
- `npm test`, the unit tests;
|
||||
- `npm run test:e2e`, the end-to-end tests. They download libsimplex and the add-on pinned in packages/simplex-chat-nodejs/src/release.ts, and smp-server and xftp-server of the simplexmq release in test/e2e/smpServer.ts;
|
||||
- `npm run test:e2e`, the end-to-end tests. They download libsimplex and the add-on pinned by the installed `simplex-chat`, and smp-server and xftp-server of the simplexmq release in test/e2e/smpServer.ts;
|
||||
- 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`.
|
||||
|
||||
@@ -176,7 +174,6 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve
|
||||
|
||||
| Scope | Paths | CI |
|
||||
|---|---|---|
|
||||
| ios | apps/ios/** | compile only |
|
||||
| types package | packages/simplex-chat-client/types/typescript/** | compile only |
|
||||
| ts-client | packages/simplex-chat-client/typescript/** | - |
|
||||
| webrtc | packages/simplex-chat-webrtc/** | - |
|
||||
|
||||
@@ -17,7 +17,7 @@ trap 'rm -rf "$tmp"' EXIT
|
||||
|
||||
# The linker resolves symbols by name only, so the stub signatures are not checked.
|
||||
sed -n 's/^extern [^(]*[ *]\([a-z_]*\)(.*/\1/p' "$IOS_DIR/SimpleXChat/SimpleX.h" "$IOS_DIR/SimpleXChat/hs_init.c" \
|
||||
| sort -u | sed 's/.*/void &(void) {}/' > "$tmp/stubs.c"
|
||||
| sort -u | sed -E -e 's/^(chat_migrate_init|chat_migrate_init_key)$/void *calloc(unsigned long, unsigned long); char *\1(void) { return calloc(1, 1); }/' -e t -e 's/.*/void &(void) {}/' > "$tmp/stubs.c"
|
||||
|
||||
if [ ! -s "$tmp/stubs.c" ]; then
|
||||
echo "Error: no extern functions found in SimpleX.h and hs_init.c" >&2
|
||||
|
||||
@@ -72,8 +72,8 @@ BUILD_CHANGES = {
|
||||
".github/actions/**",
|
||||
".github/changelog_conf.json",
|
||||
],
|
||||
"kotlin": ["apps/multiplatform/**", "Dockerfile*", ".github/workflows/build.yml", ".github/actions/**"],
|
||||
"ios": ["apps/ios/**", "scripts/ci/ios-stub-libs.sh"],
|
||||
"kotlin": ["apps/multiplatform/**", "tests/fixtures/api/**", "Dockerfile*", ".github/workflows/build.yml", ".github/actions/**"],
|
||||
"ios": ["apps/ios/**", "tests/fixtures/api/**", "scripts/ci/ios-stub-libs.sh"],
|
||||
"packages": [
|
||||
"packages/simplex-chat-nodejs/**",
|
||||
"packages/simplex-chat-client/types/typescript/**",
|
||||
@@ -85,11 +85,7 @@ SCOPE_CHANGES = {
|
||||
"badge-web": ["apps/simplex-store-service/web/**"],
|
||||
"ci-scripts": ["scripts/ci/packages_release.py", "scripts/ci/test_packages_release.py"],
|
||||
"website": ["website/src/js/simplex-lib.jsc", "website/test/**", "website/package.json"],
|
||||
"mcp": [
|
||||
"packages/simplex-chat-mcp/**",
|
||||
"packages/simplex-chat-nodejs/**",
|
||||
"packages/simplex-chat-client/types/typescript/**",
|
||||
],
|
||||
"mcp": ["packages/simplex-chat-mcp/**"],
|
||||
"support-bot": ["apps/simplex-support-bot/**"],
|
||||
"support-bot-light": ["apps/simplex-support-bot-light/**", "packages/simplex-chat-python/**"],
|
||||
}
|
||||
|
||||
@@ -15,11 +15,8 @@ case "${1:-}" in
|
||||
(cd website && npm test)
|
||||
;;
|
||||
mcp)
|
||||
(cd packages/simplex-chat-client/types/typescript && npm install --no-audit --no-fund && npx tsc)
|
||||
(cd packages/simplex-chat-nodejs && npm install --ignore-scripts --no-save --no-audit --no-fund ../simplex-chat-client/types/typescript && npx tsc && cp src/simplex.* dist)
|
||||
cd packages/simplex-chat-mcp
|
||||
npm ci --no-audit --no-fund
|
||||
npm install --no-save --no-audit --no-fund ../simplex-chat-nodejs ../simplex-chat-client/types/typescript
|
||||
npx tsc
|
||||
npx tsc -p test/tsconfig.json --noEmit
|
||||
npm test
|
||||
|
||||
@@ -480,6 +480,9 @@ class ChangesTest(GitRepoTest):
|
||||
def test_core_change_builds_only_the_core(self):
|
||||
self.assertEqual(self.builds("src/Simplex/Chat.hs"), {"haskell"})
|
||||
|
||||
def test_api_fixture_change_builds_the_core_and_both_apps(self):
|
||||
self.assertEqual(self.builds("tests/fixtures/api/names/plan-known-expired.json"), {"haskell", "kotlin", "ios"})
|
||||
|
||||
def test_ios_stub_script_builds_only_ios(self):
|
||||
self.assertEqual(self.builds("scripts/ci/ios-stub-libs.sh"), {"ios"})
|
||||
|
||||
@@ -523,9 +526,9 @@ class ChangesTest(GitRepoTest):
|
||||
self.assertEqual(self.builds("packages/simplex-chat-mcp/src/tools.ts"), set())
|
||||
self.assertEqual(self.values["scopes"], "mcp")
|
||||
|
||||
def test_library_change_builds_packages_and_tests_the_mcp_scope(self):
|
||||
def test_library_change_builds_packages_without_the_mcp_scope(self):
|
||||
self.assertEqual(self.builds("packages/simplex-chat-nodejs/src/api.ts"), {"packages"})
|
||||
self.assertEqual(self.values["scopes"], "mcp")
|
||||
self.assertEqual(self.values["scopes"], "")
|
||||
|
||||
def test_support_bot_change_tests_its_scope(self):
|
||||
self.assertEqual(self.builds("apps/simplex-support-bot/src/bot.ts"), set())
|
||||
|
||||
Reference in new issue
Block a user