Skip to content

Commit

Permalink
Updating v4 workflow and tests (#40)
Browse files Browse the repository at this point in the history
* Updating v4 workflow and tests

* Removing unnecessary export
  • Loading branch information
vicenterusso authored Apr 1, 2024
1 parent b4c5443 commit 3fb3795
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 26 deletions.
16 changes: 7 additions & 9 deletions .github/actions/prepare-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@ description: "Prepares the build for Isar Core"
runs:
using: "composite"
steps:
- name: Install latest Rust nightly
uses: actions-rs/toolchain@v1
- name: Install latest Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Install LLVM and Clang
if: runner.os == 'Windows'
uses: KyleMayes/install-llvm-action@v1
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- name: Install Perl
if: runner.os == 'Windows'
uses: shogo82148/actions-setup-perl@v1
with:
distribution: strawberry
perl-version: "5.32"
- name: Install make with Chocolatey
if: runner.os == 'Windows'
shell: bash
run: |
choco install make
- name: Set Windows environment variables
if: runner.os == 'Windows'
shell: pwsh
Expand Down
44 changes: 34 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ secrets.FLUTTER_VERSION }}
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Check formatting
run: dart format -o none . --set-exit-if-changed

Expand All @@ -29,7 +29,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ secrets.FLUTTER_VERSION }}
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- run: dart pub get
working-directory: packages/isar
- run: flutter pub get
Expand Down Expand Up @@ -66,6 +66,8 @@ jobs:
- run: echo "$OSTYPE"
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -82,6 +84,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -100,6 +104,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -118,8 +124,8 @@ jobs:
working-directory: packages/isar
- name: Collect isar_core Coverage
run: |
cargo install cargo-tarpaulin
cargo tarpaulin -o Lcov --engine llvm
cargo install cargo-tarpaulin --version 0.24.0 --force
cargo tarpaulin -o Json -v
- name: Upload isar_test Coverage
uses: codecov/codecov-action@v3
with:
Expand All @@ -137,6 +143,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Run Generator Unit tests
run: |
dart pub get
Expand All @@ -145,14 +153,16 @@ jobs:

integration_test_ios:
name: Integration Test iOS
runs-on: macos-13
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Start simulator
uses: futureware-tech/simulator-action@v2
uses: futureware-tech/simulator-action@v3
with:
model: iPhone 14
model: iPhone 13
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -175,6 +185,8 @@ jobs:
java-version: "11"
distribution: "zulu"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -199,6 +211,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -210,7 +224,7 @@ jobs:
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-macos-desktop
flutter config --enable-macos-desktop
flutter test -d macos integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test

Expand All @@ -221,6 +235,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Install Linux requirements
Expand All @@ -235,7 +251,7 @@ jobs:
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-linux-desktop
flutter config --enable-linux-desktop
flutter test -d linux integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test

Expand All @@ -246,6 +262,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -256,7 +274,7 @@ jobs:
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-windows-desktop
flutter config --enable-windows-desktop
flutter test -d windows integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test

Expand All @@ -266,6 +284,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand All @@ -291,6 +311,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand Down Expand Up @@ -318,6 +340,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ vars.FLUTTER_VERSION_V4 }}
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
Expand Down
2 changes: 1 addition & 1 deletion packages/isar/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ dependencies:

dev_dependencies:
build_test: ^2.2.0
ffigen: ^10.0.0
ffigen: ^9.0.1
test: any
very_good_analysis: ^5.1.0
6 changes: 3 additions & 3 deletions packages/isar_test/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -402,7 +402,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -451,7 +451,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
3 changes: 2 additions & 1 deletion packages/mdbx_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ const LIBMDBX_TAG: &str = "v0.12.9";

fn main() {
println!("cargo:rerun-if-changed=build.rs");
env::set_var("IPHONEOS_DEPLOYMENT_TARGET", "11.0");
env::set_var("IPHONEOS_DEPLOYMENT_TARGET", "12.0");
env::set_var("RUST_BACKTRACE", "full");

let is_android = env::var("CARGO_CFG_TARGET_OS").unwrap() == "android";

Expand Down
2 changes: 1 addition & 1 deletion tool/build_ios.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export IPHONEOS_DEPLOYMENT_TARGET=11.0
export IPHONEOS_DEPLOYMENT_TARGET=12.0

rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios
cargo build --target aarch64-apple-ios --features sqlcipher --release
Expand Down
1 change: 0 additions & 1 deletion tool/build_windows.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
if [ "$1" = "x64" ]; then
export PATH=/c/mingw64/bin:$PATH # Some bastard installer removes this from path during preparation
rustup target add x86_64-pc-windows-msvc
cargo build --target x86_64-pc-windows-msvc --features sqlcipher-vendored --release
mv "target/x86_64-pc-windows-msvc/release/isar.dll" "isar_windows_x64.dll"
Expand Down

0 comments on commit 3fb3795

Please sign in to comment.