2026-04-16 07:40:34 +02:00
|
|
|
version: "3"
|
2026-04-16 11:48:37 +02:00
|
|
|
silent: true
|
2026-04-16 07:40:34 +02:00
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
default:
|
2026-04-16 15:14:18 +02:00
|
|
|
desc: Run all checks (analyze + unit tests + widget tests + integration, in parallel)
|
2026-04-16 07:40:34 +02:00
|
|
|
deps: [check]
|
|
|
|
|
|
2026-04-25 07:12:56 +02:00
|
|
|
_preflight:
|
2026-04-16 07:40:34 +02:00
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
preconditions:
|
|
|
|
|
- sh: test "${DIRENV_DIR#-}" = "{{.TASKFILE_DIR}}"
|
|
|
|
|
msg: "Not in nix dev shell. Run: nix develop"
|
2026-04-25 07:12:56 +02:00
|
|
|
cmds:
|
|
|
|
|
- scripts/silent_on_success.sh pre-commit install
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-17 12:17:51 +02:00
|
|
|
_flutter-check:
|
2026-04-17 10:05:31 +02:00
|
|
|
internal: true
|
|
|
|
|
run: once
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight]
|
2026-04-17 12:17:51 +02:00
|
|
|
cmds:
|
2026-04-25 07:07:05 +02:00
|
|
|
- cmd: scripts/silent_on_success.sh fvm install --skip-pub-get
|
2026-04-17 12:17:51 +02:00
|
|
|
|
|
|
|
|
_pub-get:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
deps: [_flutter-check]
|
2026-04-17 10:05:31 +02:00
|
|
|
cmds:
|
2026-04-25 07:07:05 +02:00
|
|
|
- scripts/silent_on_success.sh fvm flutter pub get --suppress-analytics
|
2026-04-17 22:20:10 +02:00
|
|
|
|
|
|
|
|
_linux-deps-check:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
preconditions:
|
|
|
|
|
- sh: command -v clang >/dev/null 2>&1
|
|
|
|
|
msg: "Linux desktop deps missing. Run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev"
|
2026-04-25 07:07:05 +02:00
|
|
|
- sh: /usr/bin/pkg-config --exists gtk+-3.0 2>/dev/null
|
2026-04-17 22:20:10 +02:00
|
|
|
msg: "Linux desktop deps missing. Run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev"
|
2026-04-17 10:05:31 +02:00
|
|
|
|
2026-04-16 09:55:15 +02:00
|
|
|
install-hooks:
|
2026-04-16 15:14:18 +02:00
|
|
|
desc: Install pre-commit hooks (requires pre-commit; see .pre-commit-config.yaml)
|
2026-04-16 09:55:15 +02:00
|
|
|
cmds:
|
2026-04-16 15:14:18 +02:00
|
|
|
- pre-commit install
|
2026-04-16 09:55:15 +02:00
|
|
|
|
2026-04-25 07:07:05 +02:00
|
|
|
_codegen:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
deps: [_pub-get]
|
|
|
|
|
cmds:
|
|
|
|
|
- scripts/silent_on_success.sh fvm flutter pub run build_runner build --delete-conflicting-outputs
|
|
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
codegen:
|
2026-04-16 08:11:29 +02:00
|
|
|
desc: Generate Drift DB code (run after any schema change)
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight, _pub-get]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter pub run build_runner build --delete-conflicting-outputs
|
2026-04-16 07:40:34 +02:00
|
|
|
|
|
|
|
|
analyze:
|
2026-04-16 11:48:37 +02:00
|
|
|
desc: Static analysis (flutter analyze)
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight, _codegen]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-16 11:48:37 +02:00
|
|
|
- scripts/run_analyze.sh
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-20 18:08:09 +02:00
|
|
|
format:
|
|
|
|
|
desc: Format all Dart source files
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight]
|
2026-04-20 18:08:09 +02:00
|
|
|
cmds:
|
|
|
|
|
- fvm dart format .
|
|
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
analyze-fix:
|
2026-04-16 08:11:29 +02:00
|
|
|
desc: Auto-fix lint issues with dart fix --apply
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm dart fix --apply
|
2026-04-16 07:40:34 +02:00
|
|
|
|
|
|
|
|
test:
|
2026-04-16 11:48:37 +02:00
|
|
|
desc: Unit tests + coverage gate (fails if any non-excluded lib/ file is missing)
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight, _codegen]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-16 11:48:37 +02:00
|
|
|
- scripts/run_unit_tests.sh
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-16 15:14:18 +02:00
|
|
|
test-widget:
|
|
|
|
|
desc: Widget tests — headless, no display or network required
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight, _codegen]
|
2026-04-16 15:14:18 +02:00
|
|
|
cmds:
|
2026-04-17 10:05:31 +02:00
|
|
|
- scripts/run_widget_tests.sh
|
2026-04-16 15:14:18 +02:00
|
|
|
|
2026-04-16 08:11:29 +02:00
|
|
|
test-flutter:
|
2026-04-16 15:14:18 +02:00
|
|
|
desc: Full Flutter test suite (unit + widget + integration)
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight]
|
2026-04-16 08:11:29 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter test
|
2026-04-16 08:11:29 +02:00
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
integration:
|
2026-04-16 11:48:37 +02:00
|
|
|
desc: Integration tests against a local Stalwart mail server
|
2026-04-17 12:17:51 +02:00
|
|
|
deps: [_flutter-check]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-16 11:48:37 +02:00
|
|
|
- stalwart-dev/test.sh
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-25 17:55:52 +02:00
|
|
|
integration-ui:
|
|
|
|
|
desc: UI E2E tests on Linux via Xvfb — headless, no emulator needed
|
|
|
|
|
deps: [_preflight, _linux-deps-check, _pub-get]
|
|
|
|
|
cmds:
|
|
|
|
|
- stalwart-dev/integration_ui_test.sh
|
|
|
|
|
|
2026-04-25 06:13:38 +02:00
|
|
|
integration-android:
|
|
|
|
|
desc: UI integration tests on a connected Android emulator (Stalwart on host, emulator reaches it via 10.0.2.2)
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight, _android-sdk-check]
|
2026-04-25 06:13:38 +02:00
|
|
|
cmds:
|
|
|
|
|
- stalwart-dev/integration_android_test.sh
|
|
|
|
|
|
2026-04-17 10:05:31 +02:00
|
|
|
build-linux:
|
|
|
|
|
desc: Build the Linux desktop app (debug)
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight, _linux-deps-check, _codegen]
|
2026-04-17 10:05:31 +02:00
|
|
|
cmds:
|
2026-04-25 07:07:05 +02:00
|
|
|
- scripts/silent_on_success.sh fvm flutter build linux --debug --no-pub
|
2026-04-17 10:05:31 +02:00
|
|
|
|
2026-04-19 15:30:42 +02:00
|
|
|
_android-sdk-check:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
preconditions:
|
|
|
|
|
- sh: test -d "${ANDROID_HOME:-$HOME/Android/Sdk}"
|
|
|
|
|
msg: |
|
|
|
|
|
Android SDK not found. Install it with:
|
|
|
|
|
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O /tmp/cmdtools.zip
|
|
|
|
|
mkdir -p ~/Android/Sdk/cmdline-tools
|
|
|
|
|
unzip /tmp/cmdtools.zip -d ~/Android/Sdk/cmdline-tools
|
|
|
|
|
mv ~/Android/Sdk/cmdline-tools/cmdline-tools ~/Android/Sdk/cmdline-tools/latest
|
|
|
|
|
~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager "platform-tools" "build-tools;34.0.0" "platforms;android-34"
|
|
|
|
|
- sh: ls "${ANDROID_HOME:-$HOME/Android/Sdk}/platforms/" 2>/dev/null | grep -qE '^android-([3-9][4-9]|[4-9][0-9]|[1-9][0-9]{2,})$'
|
|
|
|
|
msg: |
|
|
|
|
|
Android platform 34 or higher not found. Install it with:
|
|
|
|
|
${ANDROID_HOME:-$HOME/Android/Sdk}/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0" "platforms;android-34"
|
|
|
|
|
|
2026-04-27 07:13:13 +02:00
|
|
|
_mobsf-start:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
cmds:
|
|
|
|
|
- cmd: |
|
|
|
|
|
if ! docker ps -q --filter name=mobsf-sharedinbox | grep -q .; then
|
|
|
|
|
docker rm mobsf-sharedinbox 2>/dev/null || true
|
|
|
|
|
docker pull -q opensecurity/mobile-security-framework-mobsf:latest >/dev/null 2>&1 || true
|
|
|
|
|
docker run -d --rm \
|
|
|
|
|
--name mobsf-sharedinbox \
|
|
|
|
|
-p 8000:8000 \
|
|
|
|
|
-e MOBSF_API_KEY=sharedinbox-dev \
|
|
|
|
|
opensecurity/mobile-security-framework-mobsf:latest >/dev/null
|
|
|
|
|
fi
|
|
|
|
|
|
2026-04-16 09:43:24 +02:00
|
|
|
build-android:
|
2026-04-26 19:02:19 +02:00
|
|
|
desc: Build a release APK and run a MobSF security scan
|
2026-04-27 07:13:13 +02:00
|
|
|
deps: [_preflight, _android-sdk-check, _pub-get, _mobsf-start]
|
2026-04-19 15:30:42 +02:00
|
|
|
cmds:
|
2026-04-25 17:55:52 +02:00
|
|
|
- ANDROID_HOME=${ANDROID_HOME:-$HOME/Android/Sdk} fvm flutter build apk --release --no-pub | grep -Ev "was tree-shaken|Tree-shaking can be disabled"
|
2026-04-26 19:02:19 +02:00
|
|
|
- scripts/mobsf_scan.sh
|
|
|
|
|
|
|
|
|
|
mobsf-stop:
|
|
|
|
|
desc: Stop the MobSF Docker container (started automatically by build-android)
|
|
|
|
|
cmds:
|
|
|
|
|
- docker stop mobsf-sharedinbox 2>/dev/null || true
|
2026-04-19 15:30:42 +02:00
|
|
|
|
|
|
|
|
deploy-android:
|
|
|
|
|
desc: Build release APK and upload via scp to $ANDROID_APK_SCP_USER@$ANDROID_APK_SCP_HOST:$ANDROID_APK_SCP_PATH
|
2026-04-26 22:31:25 +02:00
|
|
|
deps: [check, build-android]
|
2026-04-19 15:30:42 +02:00
|
|
|
dotenv: [".env"]
|
2026-04-16 09:43:24 +02:00
|
|
|
cmds:
|
2026-04-26 22:31:25 +02:00
|
|
|
# integration-android runs after check (not in parallel) so the two E2E
|
|
|
|
|
# test suites don't compete for CPU and slow the Android emulator.
|
|
|
|
|
- task: integration-android
|
2026-04-19 15:30:42 +02:00
|
|
|
- scripts/deploy_android.sh
|
2026-04-16 09:43:24 +02:00
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
run:
|
|
|
|
|
desc: Run the app on Linux desktop
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight, _linux-deps-check, _pub-get]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter run -d linux --no-pub
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-26 21:22:38 +02:00
|
|
|
run-android:
|
|
|
|
|
desc: Run the app on a connected Android emulator (boots sharedinbox_test AVD if needed)
|
|
|
|
|
deps: [_preflight, _android-sdk-check, _pub-get]
|
|
|
|
|
cmds:
|
|
|
|
|
- stalwart-dev/run_android.sh
|
|
|
|
|
|
2026-04-21 08:27:16 +02:00
|
|
|
coverage:
|
|
|
|
|
desc: Coverage gate — run after test (and optionally integration) have written lcov.info
|
2026-04-25 07:12:56 +02:00
|
|
|
deps: [_preflight]
|
2026-04-21 08:27:16 +02:00
|
|
|
cmds:
|
|
|
|
|
- fvm dart run scripts/check_coverage.dart
|
|
|
|
|
|
2026-04-18 16:16:35 +02:00
|
|
|
check-fast:
|
|
|
|
|
desc: Pre-commit checks — analyze + unit tests + widget tests (no build, no integration)
|
|
|
|
|
deps: [analyze, test, test-widget]
|
|
|
|
|
|
2026-04-27 07:13:13 +02:00
|
|
|
_integrations:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
deps: [integration, integration-ui]
|
|
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
check:
|
2026-04-21 08:27:16 +02:00
|
|
|
desc: Full check suite — unit tests first, then integration (merges coverage), then gate
|
|
|
|
|
deps: [analyze, test-widget, build-linux, test]
|
|
|
|
|
cmds:
|
2026-04-27 07:13:13 +02:00
|
|
|
- task: _integrations
|
2026-04-21 08:27:16 +02:00
|
|
|
- task: coverage
|