mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-31 05:44:25 +01:00
gh workflow for dart (test, precompile, publish), only test is activated
This commit is contained in:
100
.github/workflows/dart.yml
vendored
Normal file
100
.github/workflows/dart.yml
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
name: Dart/Flutter
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
env:
|
||||
working-directory: bindings/dart
|
||||
jobs:
|
||||
test:
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ env.working-directory }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- blacksmith-4vcpu-ubuntu-2404
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Rust (stable)
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Setup Dart
|
||||
uses: dart-lang/setup-dart@v1
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Get flutter deps
|
||||
run: flutter pub get
|
||||
- name: Build test binaries
|
||||
run: cargo build --package turso_dart --target-dir=rust/test_build
|
||||
- name: Run tests
|
||||
run: flutter test
|
||||
precompile:
|
||||
if: ${{ false && startsWith(github.ref, 'refs/tags/') }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ env.working-directory }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- blacksmith-4vcpu-ubuntu-2404
|
||||
- macOS-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Rust (stable)
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Setup Dart
|
||||
uses: dart-lang/setup-dart@v1
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Set up Android SDK
|
||||
if: (matrix.os == 'ubuntu-latest')
|
||||
uses: android-actions/setup-android@v2
|
||||
- name: Install specific NDK
|
||||
if: (matrix.os == 'ubuntu-latest')
|
||||
run: sdkmanager --install "ndk;25.1.8937393"
|
||||
- name: Get flutter deps
|
||||
run: flutter pub get
|
||||
- name: Precompile
|
||||
if: (matrix.os == 'macOS-latest') || (matrix.os == 'windows-latest')
|
||||
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=dikatok/libsql_dart
|
||||
working-directory: cargokit/build_tool
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}
|
||||
- name: Precompile (with Android)
|
||||
if: (matrix.os == 'ubuntu-latest')
|
||||
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=dikatok/libsql_dart --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=25.1.8937393 --android-min-sdk-version=23
|
||||
working-directory: cargokit/build_tool
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}
|
||||
publish:
|
||||
if: ${{ false && startsWith(github.ref, 'refs/tags/') }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ env.working-directory }}
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: "Publish libsql_dart"
|
||||
uses: k-paxian/dart-package-publisher@v.1.6.2
|
||||
with:
|
||||
accessToken: ${{ secrets.PUBDEV_ACCESS_TOKEN }}
|
||||
refreshToken: ${{ secrets.PUBDEV_REFRESH_TOKEN }}
|
||||
skipTests: true
|
||||
force: true
|
||||
8
bindings/dart/cargokit_options.yaml
Normal file
8
bindings/dart/cargokit_options.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
# Enables verbose logging of cargokit during build
|
||||
verbose_logging: true
|
||||
|
||||
# Opts out of using precompiled binaries. If crate has configured
|
||||
# and deployed precompiled binaries, these will be by default used whenever Rustup
|
||||
# is not installed. With `use_precompiled_binaries` set to false, the build will
|
||||
# instead be aborted prompting user to install Rustup.
|
||||
use_precompiled_binaries: true
|
||||
11
bindings/dart/rust/cargokit.yaml
Normal file
11
bindings/dart/rust/cargokit.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
cargo:
|
||||
debug:
|
||||
toolchain: stable
|
||||
release:
|
||||
toolchain: stable
|
||||
|
||||
precompiled_binaries:
|
||||
# Uri prefix used when downloading precompiled binaries.
|
||||
url_prefix: https://github.com/dikatok/libsql_dart/releases/download/v
|
||||
# Public key for verifying downloaded precompiled binaries.
|
||||
public_key:
|
||||
Reference in New Issue
Block a user