Skip to content

Commit e4a3361

Browse files
authored
ci: move native builds out of per-PR CI (#19)
* ci: move native builds out of per-PR CI Match upstream Acode: ci.yml keeps only fast checks (spelling, Biome, unit tests, typecheck, translations). Native tests move to a new native-tests.yml that runs only the platform a PR touches, plus a daily and manual full run. APKs are built only by nightly and on-demand preview releases. Also select the Android edition via androidPackageId (npm pkg set name was a no-op, so the free build was actually paid) and install the required Android SDK packages in the nightly build. * fix: CI spelling errors and sdkmanager path sdkmanager is not on PATH on GitHub's Ubuntu runners, so call it from ANDROID_HOME. Allow Apple's udid in typos and fix the onSucess typo. * fix: use android-37.0 SDK platform package name * test: drop removed ServiceName.fromKey assertion fromKey was removed from ServiceName; Bridge resolves services through the registry map, so the test now only checks keys are unique.
1 parent 134a080 commit e4a3361

6 files changed

Lines changed: 180 additions & 103 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -107,102 +107,3 @@ jobs:
107107
npm ci --no-audit --no-fund
108108
npm run lang check
109109
110-
ios:
111-
name: Acode iOS
112-
runs-on: macos-26
113-
timeout-minutes: 30
114-
permissions:
115-
contents: read
116-
steps:
117-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
118-
with:
119-
submodules: recursive
120-
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
121-
with:
122-
node-version: '24'
123-
cache: npm
124-
- name: Install dependencies
125-
run: npm ci --no-audit --no-fund
126-
- name: Install Alpine runtime build tools
127-
run: brew install meson ninja llvm lld
128-
- name: Prepare local iOS configuration
129-
run: cp platforms/ios/Config.xcconfig.example platforms/ios/Config.xcconfig
130-
- name: Select iPhone and iPad simulators with working StoreKit testing
131-
id: simulator
132-
run: |
133-
node <<'JS'
134-
const { execFileSync } = require('node:child_process');
135-
const { appendFileSync } = require('node:fs');
136-
const { devices } = JSON.parse(execFileSync('xcrun', ['simctl', 'list', 'devices', 'available', '--json']));
137-
// iOS 26.3–26.5 fails SKTestSession configuration in command-line runs:
138-
// https://developer.apple.com/forums/thread/826971
139-
const supported = ['iOS-18-6', 'iOS-26-2'].flatMap(version =>
140-
devices[`com.apple.CoreSimulator.SimRuntime.${version}`] || []);
141-
for (const [family, output] of [['iPhone', 'id'], ['iPad', 'ipad']]) {
142-
const device = supported.find(device => device.isAvailable &&
143-
device.deviceTypeIdentifier?.startsWith(`com.apple.CoreSimulator.SimDeviceType.${family}-`));
144-
if (!device) throw new Error(`Install an iOS 18.6 or 26.2 ${family} simulator for integration tests`);
145-
appendFileSync(process.env.GITHUB_OUTPUT, `${output}=${device.udid}\n`);
146-
}
147-
JS
148-
- name: Build and run simulator tests with SSH and FTP fixtures
149-
run: |
150-
python3 -m venv .ios-build/ssh-fixture-venv
151-
.ios-build/ssh-fixture-venv/bin/pip install -r tests/fixtures/ssh/requirements.txt
152-
.ios-build/ssh-fixture-venv/bin/python tests/fixtures/ssh/server.py -- npm run test:ios -- --target=${{ steps.simulator.outputs.id }}
153-
- name: Run iPad startup and native UI checks
154-
run: |
155-
checks=()
156-
for test in AppBridgeTests SystemUITests KeyboardLayoutTests PlatformUITests HapticControlsTests DocumentsPickerTests ShareTests PreviewBrowserTests FilesBrowserTests BrowserBridgeTests; do
157-
checks+=("-only-testing:runnerTests/$test")
158-
done
159-
checks+=("-only-testing:runnerUITests/AppIconUITests")
160-
xcodebuild -project platforms/ios/runner.xcodeproj -scheme runner \
161-
-configuration Debug -sdk iphonesimulator \
162-
-destination 'platform=iOS Simulator,id=${{ steps.simulator.outputs.ipad }}' \
163-
-derivedDataPath .ios-build -clonedSourcePackagesDirPath .ios-build/SourcePackages \
164-
-parallel-testing-enabled NO -collect-test-diagnostics never \
165-
"${checks[@]}" CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY=- test-without-building
166-
167-
android:
168-
name: Acode Android (${{ matrix.variant }}, ${{ matrix.distribution }})
169-
runs-on: ubuntu-latest
170-
timeout-minutes: 45
171-
strategy:
172-
fail-fast: false
173-
matrix:
174-
include:
175-
- variant: paid
176-
package: com.foxdebug.acode
177-
distribution: store
178-
- variant: free
179-
package: com.foxdebug.acodefree
180-
distribution: store
181-
- variant: paid
182-
package: com.foxdebug.acode
183-
distribution: fdroid
184-
steps:
185-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
186-
with:
187-
submodules: recursive
188-
- uses: actions/setup-java@v6
189-
with:
190-
distribution: temurin
191-
java-version: '26'
192-
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
193-
with:
194-
node-version: '24'
195-
cache: npm
196-
- name: Install dependencies
197-
run: npm ci --no-audit --no-fund
198-
- name: Install Android SDK packages
199-
run: sdkmanager 'platforms;android-37' 'build-tools;36.0.0'
200-
- name: Select package
201-
run: npm pkg set name=${{ matrix.package }}
202-
- name: Build APK
203-
run: npm run build -- dev apk ${{ matrix.distribution }}
204-
- name: Native tests
205-
run: npm run test:android -- ${{ matrix.distribution }}
206-
- name: Validate minified release bundle
207-
if: matrix.distribution == 'store'
208-
run: npm run build -- prod bundle

‎.github/workflows/native-tests.yml‎

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
name: Native Tests
2+
3+
# Native suites are slow (macOS runners, Gradle), so PRs only run the platform
4+
# whose code they touch; the daily run catches breakage coming from src/.
5+
on:
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- 'platforms/**'
11+
- 'dev/**'
12+
- 'tests/fixtures/ssh/**'
13+
- 'package.json'
14+
- 'package-lock.json'
15+
- '.github/workflows/native-tests.yml'
16+
pull_request:
17+
paths:
18+
- 'platforms/**'
19+
- 'dev/**'
20+
- 'tests/fixtures/ssh/**'
21+
- 'package.json'
22+
- 'package-lock.json'
23+
- '.github/workflows/native-tests.yml'
24+
schedule:
25+
- cron: "0 5 * * *"
26+
workflow_dispatch:
27+
28+
permissions:
29+
contents: read
30+
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
33+
cancel-in-progress: true
34+
35+
jobs:
36+
changes:
37+
name: Detect changed platforms
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 5
40+
permissions:
41+
contents: read
42+
pull-requests: read
43+
outputs:
44+
android: ${{ steps.filter.outputs.android }}
45+
ios: ${{ steps.filter.outputs.ios }}
46+
steps:
47+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
48+
if: github.event_name == 'push' || github.event_name == 'pull_request'
49+
- name: Detect changed files
50+
id: filter
51+
if: github.event_name == 'push' || github.event_name == 'pull_request'
52+
uses: dorny/paths-filter@v4
53+
with:
54+
filters: |
55+
shared: &shared
56+
- 'dev/config.js'
57+
- 'dev/sync.js'
58+
- 'dev/scripts/native.js'
59+
- 'dev/scripts/build.sh'
60+
- 'package.json'
61+
- 'package-lock.json'
62+
- '.github/workflows/native-tests.yml'
63+
android:
64+
- *shared
65+
- 'platforms/android/**'
66+
- 'dev/storage_manager.mjs'
67+
- 'dev/scripts/android.js'
68+
ios:
69+
- *shared
70+
- 'platforms/ios/**'
71+
- 'dev/ios/**'
72+
- 'dev/scripts/ios.js'
73+
- 'dev/scripts/iosAds.js'
74+
- 'tests/fixtures/ssh/**'
75+
76+
android:
77+
name: Android (${{ matrix.variant }}, ${{ matrix.distribution }})
78+
needs: changes
79+
if: needs.changes.outputs.android == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
80+
runs-on: ubuntu-latest
81+
timeout-minutes: 30
82+
strategy:
83+
fail-fast: false
84+
matrix:
85+
include:
86+
- variant: paid
87+
package: com.foxdebug.acode
88+
distribution: store
89+
- variant: free
90+
package: com.foxdebug.acodefree
91+
distribution: store
92+
- variant: paid
93+
package: com.foxdebug.acode
94+
distribution: fdroid
95+
steps:
96+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
97+
with:
98+
submodules: recursive
99+
- uses: actions/setup-java@v6
100+
with:
101+
distribution: temurin
102+
java-version: '26'
103+
cache: gradle
104+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
105+
with:
106+
node-version: '24'
107+
cache: npm
108+
- name: Install dependencies
109+
run: npm ci --no-audit --no-fund
110+
- name: Install Android SDK packages
111+
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager 'platforms;android-37.0' 'build-tools;36.0.0'
112+
- name: Select package
113+
run: npm pkg set androidPackageId=${{ matrix.package }}
114+
- name: Native unit tests
115+
run: npm run test:android -- ${{ matrix.distribution }}
116+
117+
ios:
118+
name: iOS
119+
needs: changes
120+
if: needs.changes.outputs.ios == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
121+
runs-on: macos-26
122+
timeout-minutes: 30
123+
steps:
124+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
125+
with:
126+
submodules: recursive
127+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
128+
with:
129+
node-version: '24'
130+
cache: npm
131+
- name: Install dependencies
132+
run: npm ci --no-audit --no-fund
133+
- name: Install Alpine runtime build tools
134+
run: brew install meson ninja llvm lld
135+
- name: Prepare local iOS configuration
136+
run: cp platforms/ios/Config.xcconfig.example platforms/ios/Config.xcconfig
137+
- name: Select iPhone and iPad simulators with working StoreKit testing
138+
id: simulator
139+
run: |
140+
node <<'JS'
141+
const { execFileSync } = require('node:child_process');
142+
const { appendFileSync } = require('node:fs');
143+
const { devices } = JSON.parse(execFileSync('xcrun', ['simctl', 'list', 'devices', 'available', '--json']));
144+
// iOS 26.3–26.5 fails SKTestSession configuration in command-line runs:
145+
// https://developer.apple.com/forums/thread/826971
146+
const supported = ['iOS-18-6', 'iOS-26-2'].flatMap(version =>
147+
devices[`com.apple.CoreSimulator.SimRuntime.${version}`] || []);
148+
for (const [family, output] of [['iPhone', 'id'], ['iPad', 'ipad']]) {
149+
const device = supported.find(device => device.isAvailable &&
150+
device.deviceTypeIdentifier?.startsWith(`com.apple.CoreSimulator.SimDeviceType.${family}-`));
151+
if (!device) throw new Error(`Install an iOS 18.6 or 26.2 ${family} simulator for integration tests`);
152+
appendFileSync(process.env.GITHUB_OUTPUT, `${output}=${device.udid}\n`);
153+
}
154+
JS
155+
- name: Build and run simulator tests with SSH and FTP fixtures
156+
run: |
157+
python3 -m venv .ios-build/ssh-fixture-venv
158+
.ios-build/ssh-fixture-venv/bin/pip install -r tests/fixtures/ssh/requirements.txt
159+
.ios-build/ssh-fixture-venv/bin/python tests/fixtures/ssh/server.py -- npm run test:ios -- --target=${{ steps.simulator.outputs.id }}
160+
- name: Run iPad startup and native UI checks
161+
run: |
162+
checks=()
163+
for test in AppBridgeTests SystemUITests KeyboardLayoutTests PlatformUITests HapticControlsTests DocumentsPickerTests ShareTests PreviewBrowserTests FilesBrowserTests BrowserBridgeTests; do
164+
checks+=("-only-testing:runnerTests/$test")
165+
done
166+
checks+=("-only-testing:runnerUITests/AppIconUITests")
167+
xcodebuild -project platforms/ios/runner.xcodeproj -scheme runner \
168+
-configuration Debug -sdk iphonesimulator \
169+
-destination 'platform=iOS Simulator,id=${{ steps.simulator.outputs.ipad }}' \
170+
-derivedDataPath .ios-build -clonedSourcePackagesDirPath .ios-build/SourcePackages \
171+
-parallel-testing-enabled NO -collect-test-diagnostics never \
172+
"${checks[@]}" CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY=- test-without-building

‎.github/workflows/nightly-build.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,11 @@ jobs:
158158
run: |
159159
npm ci --no-audit --no-fund
160160
161+
- name: Install Android SDK packages
162+
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager 'platforms;android-37.0' 'build-tools;36.0.0'
163+
161164
- name: Select paid package
162-
run: npm pkg set name=com.foxdebug.acode
165+
run: npm pkg set androidPackageId=com.foxdebug.acode
163166

164167
- name: Build normal APK
165168
run: |

‎_typos.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ multline = "multline"
5757
sav = "sav"
5858
ist = "ist"
5959
Hel = "Hel"
60+
# Apple simulator device identifier
61+
udid = "udid"

‎platforms/android/app/src/test/java/com/foxdebug/acode/runtime/StartupTest.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public void startsAndResumesWithoutReloadingTheEditor() throws Exception {
5454
public void exposesEveryTransportKeyOnce() {
5555
java.util.HashSet<String> keys = new java.util.HashSet<>();
5656
for (ServiceName name : ServiceName.values()) {
57-
assertSame(name, ServiceName.fromKey(name.getKey()));
5857
assertTrue("duplicate key " + name.getKey(), keys.add(name.getKey()));
5958
}
6059
}

‎src/native/types/sftp.d.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ interface Sftp {
3636
/**
3737
* Executes command on ssh-server
3838
* @param command
39-
* @param onSucess
39+
* @param onSuccess
4040
* @param onFail
4141
*/
4242
exec(
4343
command: String,
44-
onSucess: (res: ExecResult) => void,
44+
onSuccess: (res: ExecResult) => void,
4545
onFail: (err: any) => void,
4646
): void;
4747
/** Connects using credentials held by the native profile store. */

0 commit comments

Comments
 (0)