diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 09b53cf..b442cd6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,8 +17,13 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.platform }} + include: + - platform: ubuntu-latest + - platform: macos-latest + - platform: windows-latest + - platform: android + arch: x86_64 + runs-on: ${{ matrix.platform == 'android' && 'ubuntu-latest' || matrix.platform }} steps: - name: Set git to use LF @@ -37,6 +42,7 @@ jobs: choco install openssl -y - name: Setup environment + if: ${{ matrix.platform != 'android' }} shell: bash run: | mkdir -p ~/.ssh @@ -47,8 +53,41 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: stable - - run: | - flutter test + + - name: Run tests on desktop platforms + if: ${{ matrix.platform != 'android' }} + run: | + flutter test + + - name: Setup Flutter path for Android + if: ${{ matrix.platform == 'android' }} + id: flutter-path + run: | + echo "FLUTTER_PATH=$(which flutter || echo '')" >> $GITHUB_ENV + echo "PATH=$PATH" >> $GITHUB_ENV + + - name: Run tests on Android + if: ${{ matrix.platform == 'android' }} + uses: reactivecircus/android-emulator-runner@v2 + env: + PATH: ${{ env.PATH }} + with: + api-level: 30 + arch: x86_64 + profile: Nexus 6 + ram-size: 2048M + disk-size: 4096M + script: | + + mkdir -p ~/.ssh + ssh-keyscan github.com >> ~/.ssh/known_hosts + + # Install Flutter if not available in PATH + git clone https://github.com/flutter/flutter.git -b stable --depth 1 $HOME/flutter + export PATH="$HOME/flutter/bin:$PATH" + + flutter pub get + flutter test publish: needs: test diff --git a/AGENTS.md b/AGENTS.md index 0d66c6a..8ee7409 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,28 +23,28 @@ Provide idiomatic, null-safe Dart bindings for **libgit2** that feel like native ```bash # Install dependencies -dart pub get - -# Generate FFI bindings (requires clang) -dart run ffigen +flutter pub get # Format, analyze, and test dart format . --set-exit-if-changed -dart analyze -dart test +flutter analyze +flutter test ``` -if you need to install flutter - use script `scripts/install_flutter.sh` +If you need to install Flutter, use script `scripts/install_flutter.sh`. + +**Note**: FFI bindings are provided by the `git2dart_binaries` package and do not need to be regenerated in this repository. -All targets **must** pass on Linux, macOS & Windows using Dart 3.7+ and Flutter stable. +All targets **must** pass on Linux, macOS, Windows, and Android using Dart 3.7.2+ and Flutter stable (3.29.3+). ## 5. Coding Conventions -* Follow *Effective Dart* for style and naming. +* Follow *Effective Dart* for style and naming. * Always run `dart format .` before committing. -* `dart analyze` must report **zero** warnings. +* `flutter analyze` must report **zero** warnings. * Document public symbols with `///` comments. * Throw specific `GitError` subclasses. Avoid returning `null` unless explicitly required. +* **All code, comments, commit messages, and git artifacts must be in English.** ## 6. Testing Policy @@ -62,7 +62,7 @@ All targets **must** pass on Linux, macOS & Windows using Dart 3.7+ and Flutter 2. Update `CHANGELOG.md`. 3. Tag the commit `vx.y.z`. 4. Ensure `dart pub publish --dry-run` succeeds locally and in CI. -5. Use `gh release create` to attach binaries from `tool/build_artefacts.dart`. +5. Create GitHub release with `gh release create vx.y.z` (binaries are handled by CI workflow). ## 8. Common Pitfalls @@ -70,10 +70,16 @@ All targets **must** pass on Linux, macOS & Windows using Dart 3.7+ and Flutter `dart run build_runner build --delete-conflicting-outputs` * Do not vendor full libgit2 source; use submodules or binary archives. * On Windows, ensure `libgit2.dll` is copied to `bin/` for tests to pass. +* All code, documentation, commit messages, branch names, and git artifacts must be in English. ## 9. Agent Checklist (Each Commit) -* +* [ ] Code formatted with `dart format .` +* [ ] `flutter analyze` reports zero warnings +* [ ] All tests pass (`flutter test`) +* [ ] Public API changes include documentation +* [ ] Commit message follows Conventional Commits format +* [ ] All code, comments, and commit messages are in English ## 10. Architecture @@ -85,7 +91,7 @@ Companion package with: * `ffigen` config * Generated Dart headers and auto-generated FFI code for the **libgit2** C API -Separating heavy artefacts ensures versioned, reproducible builds while letting the high-level API evolve. ensures versioned, reproducible builds while letting the high-level API evolve. +Separating heavy artefacts ensures versioned, reproducible builds while letting the high-level API evolve. ### 10.2 `lib/src/bindings` @@ -93,7 +99,7 @@ Separating heavy artefacts ensures versioned, reproducible builds while letting * Defines the Dart-level interface to C functions and structures * Handles all interaction with native memory: allocations, pointer math, conversions * All raw C calls and memory operations happen here -* No raw `Pointer` escapes; must be converted to safe Dart typesContains **bindings** to the auto-generated FFI code from `git2dart_binaries` +* No raw `Pointer` escapes; must be converted to safe Dart types ### 10.3 `lib/src` @@ -102,7 +108,21 @@ Separating heavy artefacts ensures versioned, reproducible builds while letting * Hides FFI details from end users * Contains helpers/mixins not part of public API -## 11. Contact Points +## 11. Language Requirements + +**All artifacts in code and git must be in English:** + +* Source code (variable names, function names, class names) +* Comments and documentation +* Commit messages +* Branch names +* Pull request titles and descriptions +* Issue titles and descriptions +* Code review comments + +This ensures consistency, maintainability, and accessibility for the international developer community. + +## 12. Contact Points * Open issues or PRs on GitHub * Prefix commits with Conventional Commit types (`feat:`, `fix:`, etc.)