Skip to content

Commit

Permalink
CI - test all supported platforms and versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Jan 25, 2021
1 parent a9251ad commit fb6fb10
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 12 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,36 @@ jobs:
run: ./generator/test.sh

lib:
runs-on: ubuntu-20.04
container:
image: google/dart:latest
strategy:
matrix:
os:
- windows-2019
- macos-10.15
- ubuntu-20.04
dart:
- 2.10.5
# - 2.9.3 - generator stuck. I remember there was an issue in some dependency but don't remember which one.
- 2.8.4
- 2.7.2
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
# Note: dart-sdk from flutter doesn't work on linux, see https://github.com/flutter/flutter/issues/74599
# - uses: subosito/flutter-action@v1
# with:
# flutter-version: 1.22.x
# - run: flutter --version
- uses: cedx/setup-dart@v2
with:
version: ${{ matrix.dart }}
- run: dart --version
- uses: actions/checkout@v2
- name: Install ObjectBox C-API
run: ./install.sh
- run: pub get
- run: ./tool/pub.sh get
- name: Generate ObjectBox models
run: pub run build_runner build
run: ./tool/pub.sh run build_runner build
- name: Run tests
run: pub run test
run: ./tool/pub.sh run test

valgrind:
runs-on: ubuntu-20.04
Expand All @@ -47,4 +65,4 @@ jobs:
run: |
apt update
apt install -y valgrind
- run: ./tool/valgrind.sh
- run: ./tool/valgrind.sh
2 changes: 1 addition & 1 deletion lib/src/query/query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ class Query<T> {
try {
final idArray = idArrayPtr.ref;
return idArray.count == 0
? List<int>.empty()
? List<int>.filled(0, 0)
: idArray.ids.asTypedList(idArray.count).toList(growable: false);
} finally {
C.id_array_free(idArrayPtr);
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ description: ObjectBox is a super-fast NoSQL ACID compliant object database.

environment:
# sdk: '>=2.12.0-0 <3.0.0'
sdk: '>=2.6.0 <3.0.0'
# min 2.7.0 because of ffigen
sdk: '>=2.7.0 <3.0.0'

dependencies:
collection: ^1.14.11
Expand All @@ -20,8 +21,8 @@ dev_dependencies:
build_runner: ^1.0.0
objectbox_generator:
path: generator
pedantic: ^1.10.0-nullsafety.0
test: ^1.16.0-nullsafety.0
pedantic: ^1.9.0
test: ^1.0.0
ffigen: ^1.1.0
flat_buffers: 1.12.0

Expand Down
12 changes: 12 additions & 0 deletions tool/pub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail

# forward all arguments to an available version of `pub`

if [[ `command -v pub` ]]; then
pub "$@"
elif [[ `command -v pub.bat` ]]; then
pub.bat "$@"
else
dart pub "$@"
fi

0 comments on commit fb6fb10

Please sign in to comment.