task check works, run not.
This commit is contained in:
@@ -8,5 +8,9 @@
|
|||||||
# Ensures that flake.nix gets evaluated.
|
# Ensures that flake.nix gets evaluated.
|
||||||
use flake
|
use flake
|
||||||
|
|
||||||
|
# Flutter via FVM — .fvmrc pins the version; fvm use creates .fvm/flutter_sdk.
|
||||||
|
# This must come after `use flake` so FVM Flutter takes precedence.
|
||||||
|
PATH_add .fvm/flutter_sdk/bin
|
||||||
|
|
||||||
# Load variables from .env
|
# Load variables from .env
|
||||||
dotenv_if_exists
|
dotenv_if_exists
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ jobs:
|
|||||||
integration:
|
integration:
|
||||||
name: Integration tests (Stalwart)
|
name: Integration tests (Stalwart)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Run integration tests only on push to main, not on every PR,
|
# Run integration tests only on push to main, not on every PR.
|
||||||
# since they require downloading the Stalwart binary via Nix.
|
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -54,7 +53,7 @@ jobs:
|
|||||||
channel: stable
|
channel: stable
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Enter Nix shell and run integration tests
|
- name: Run integration tests
|
||||||
run: |
|
run: |
|
||||||
nix develop --command bash -c "
|
nix develop --command bash -c "
|
||||||
flutter pub get &&
|
flutter pub get &&
|
||||||
|
|||||||
@@ -51,3 +51,6 @@ linux/flutter/generated_plugins.cmake
|
|||||||
|
|
||||||
# direnv cache
|
# direnv cache
|
||||||
.direnv/
|
.direnv/
|
||||||
|
|
||||||
|
# FVM — .fvmrc is committed; .fvm/ contains the downloaded SDK (not committed)
|
||||||
|
.fvm/
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
# Later
|
# Later
|
||||||
|
|
||||||
is there a e2e test tool in Flutter like Playwright? Application should launch, create screenshots...
|
Flutter best practices?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Flutter/Dart Linters?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
integration_test (similar to Playwright)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,17 @@ Run the app, tap **+**, and enter your IMAP/SMTP server details. The app syncs y
|
|||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
[Nix](https://nixos.org/download) with flakes enabled, and [direnv](https://direnv.net/).
|
[Nix](https://nixos.org/download) with flakes enabled and [direnv](https://direnv.net/).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# One-time: allow direnv in this directory
|
# One-time: allow direnv to load the Nix dev shell
|
||||||
direnv allow
|
direnv allow
|
||||||
|
|
||||||
|
# One-time: install the pinned Flutter version (fvm is provided by Nix)
|
||||||
|
fvm install
|
||||||
```
|
```
|
||||||
|
|
||||||
`direnv` loads the Nix flake automatically — no manual `nix develop` needed after that. The flake pins **Flutter 3.41.6**, Android SDK, Stalwart mail server (for integration tests), and all Linux desktop build tools (GTK3, clang, cmake).
|
`direnv` loads the Nix flake automatically — it provides go-task, fvm, Android SDK, Stalwart, and Linux build tools. Flutter itself is managed by FVM (pinned in `.fvmrc`) rather than Nix, which avoids glibc compatibility issues on non-NixOS hosts. `task check` also runs `fvm install` automatically if Flutter is missing.
|
||||||
|
|
||||||
### First-time setup
|
### First-time setup
|
||||||
|
|
||||||
|
|||||||
+19
-4
@@ -13,10 +13,17 @@ tasks:
|
|||||||
- sh: test "${DIRENV_DIR#-}" = "{{.TASKFILE_DIR}}"
|
- sh: test "${DIRENV_DIR#-}" = "{{.TASKFILE_DIR}}"
|
||||||
msg: "Not in nix dev shell. Run: nix develop"
|
msg: "Not in nix dev shell. Run: nix develop"
|
||||||
|
|
||||||
_pub-get:
|
_flutter-check:
|
||||||
internal: true
|
internal: true
|
||||||
run: once
|
run: once
|
||||||
deps: [_nix-check]
|
deps: [_nix-check]
|
||||||
|
cmds:
|
||||||
|
- cmd: command -v flutter >/dev/null 2>&1 || fvm install
|
||||||
|
|
||||||
|
_pub-get:
|
||||||
|
internal: true
|
||||||
|
run: once
|
||||||
|
deps: [_flutter-check]
|
||||||
cmds:
|
cmds:
|
||||||
- flutter pub get --suppress-analytics 2>/dev/null
|
- flutter pub get --suppress-analytics 2>/dev/null
|
||||||
|
|
||||||
@@ -63,7 +70,7 @@ tasks:
|
|||||||
|
|
||||||
integration:
|
integration:
|
||||||
desc: Integration tests against a local Stalwart mail server
|
desc: Integration tests against a local Stalwart mail server
|
||||||
deps: [_nix-check]
|
deps: [_flutter-check]
|
||||||
cmds:
|
cmds:
|
||||||
- stalwart-dev/test.sh
|
- stalwart-dev/test.sh
|
||||||
|
|
||||||
@@ -77,18 +84,26 @@ tasks:
|
|||||||
echo "Error: libsecret-1-dev is installed but pkg-config cannot find it."
|
echo "Error: libsecret-1-dev is installed but pkg-config cannot find it."
|
||||||
echo "Your nix shell was opened before the package was installed."
|
echo "Your nix shell was opened before the package was installed."
|
||||||
echo "Fix: exit the nix shell and re-enter with: nix develop"
|
echo "Fix: exit the nix shell and re-enter with: nix develop"
|
||||||
exit 1
|
|
||||||
else
|
else
|
||||||
echo "Error: libsecret-1-dev is not installed."
|
echo "Error: libsecret-1-dev is not installed."
|
||||||
echo "Fix: sudo apt install libsecret-1-dev"
|
echo "Fix: sudo apt install libsecret-1-dev"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
exit 1
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
desc: Build the Linux desktop app (debug)
|
desc: Build the Linux desktop app (debug)
|
||||||
deps: [_nix-check, _pub-get, _check-libsecret]
|
deps: [_nix-check, _pub-get, _check-libsecret]
|
||||||
cmds:
|
cmds:
|
||||||
- flutter build linux --debug --no-pub
|
- flutter build linux --debug --no-pub
|
||||||
|
- |
|
||||||
|
binary=build/linux/x64/debug/bundle/sharedinbox
|
||||||
|
missing=$(LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu ldd "$binary" 2>/dev/null | grep 'not found' || true)
|
||||||
|
if [ -n "$missing" ]; then
|
||||||
|
echo "Error: built binary has unresolvable runtime dependencies:"
|
||||||
|
echo "$missing"
|
||||||
|
echo "Fix: sudo apt install libsecret-1-0"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
build-android:
|
build-android:
|
||||||
desc: Build a release APK (output in build/app/outputs/flutter-apk/)
|
desc: Build a release APK (output in build/app/outputs/flutter-apk/)
|
||||||
|
|||||||
@@ -31,9 +31,6 @@
|
|||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
# Flutter / Dart toolchain
|
|
||||||
flutter
|
|
||||||
|
|
||||||
# Android
|
# Android
|
||||||
androidSdk
|
androidSdk
|
||||||
|
|
||||||
@@ -60,6 +57,9 @@
|
|||||||
# Task runner
|
# Task runner
|
||||||
go-task
|
go-task
|
||||||
|
|
||||||
|
# Flutter version manager (fvm install downloads the pinned Flutter SDK)
|
||||||
|
fvm
|
||||||
|
|
||||||
# Utilities
|
# Utilities
|
||||||
git
|
git
|
||||||
curl
|
curl
|
||||||
|
|||||||
Reference in New Issue
Block a user