Skip to content

Commit fb6fb10

Browse files
committed
CI - test all supported platforms and versions
1 parent a9251ad commit fb6fb10

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed

.github/workflows/dart.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,36 @@ jobs:
1919
run: ./generator/test.sh
2020

2121
lib:
22-
runs-on: ubuntu-20.04
23-
container:
24-
image: google/dart:latest
22+
strategy:
23+
matrix:
24+
os:
25+
- windows-2019
26+
- macos-10.15
27+
- ubuntu-20.04
28+
dart:
29+
- 2.10.5
30+
# - 2.9.3 - generator stuck. I remember there was an issue in some dependency but don't remember which one.
31+
- 2.8.4
32+
- 2.7.2
33+
runs-on: ${{ matrix.os }}
2534
steps:
26-
- uses: actions/checkout@v1
35+
# Note: dart-sdk from flutter doesn't work on linux, see https://github.com/flutter/flutter/issues/74599
36+
# - uses: subosito/flutter-action@v1
37+
# with:
38+
# flutter-version: 1.22.x
39+
# - run: flutter --version
40+
- uses: cedx/setup-dart@v2
41+
with:
42+
version: ${{ matrix.dart }}
43+
- run: dart --version
44+
- uses: actions/checkout@v2
2745
- name: Install ObjectBox C-API
2846
run: ./install.sh
29-
- run: pub get
47+
- run: ./tool/pub.sh get
3048
- name: Generate ObjectBox models
31-
run: pub run build_runner build
49+
run: ./tool/pub.sh run build_runner build
3250
- name: Run tests
33-
run: pub run test
51+
run: ./tool/pub.sh run test
3452

3553
valgrind:
3654
runs-on: ubuntu-20.04
@@ -47,4 +65,4 @@ jobs:
4765
run: |
4866
apt update
4967
apt install -y valgrind
50-
- run: ./tool/valgrind.sh
68+
- run: ./tool/valgrind.sh

lib/src/query/query.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ class Query<T> {
754754
try {
755755
final idArray = idArrayPtr.ref;
756756
return idArray.count == 0
757-
? List<int>.empty()
757+
? List<int>.filled(0, 0)
758758
: idArray.ids.asTypedList(idArray.count).toList(growable: false);
759759
} finally {
760760
C.id_array_free(idArrayPtr);

pubspec.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ description: ObjectBox is a super-fast NoSQL ACID compliant object database.
66

77
environment:
88
# sdk: '>=2.12.0-0 <3.0.0'
9-
sdk: '>=2.6.0 <3.0.0'
9+
# min 2.7.0 because of ffigen
10+
sdk: '>=2.7.0 <3.0.0'
1011

1112
dependencies:
1213
collection: ^1.14.11
@@ -20,8 +21,8 @@ dev_dependencies:
2021
build_runner: ^1.0.0
2122
objectbox_generator:
2223
path: generator
23-
pedantic: ^1.10.0-nullsafety.0
24-
test: ^1.16.0-nullsafety.0
24+
pedantic: ^1.9.0
25+
test: ^1.0.0
2526
ffigen: ^1.1.0
2627
flat_buffers: 1.12.0
2728

tool/pub.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# forward all arguments to an available version of `pub`
5+
6+
if [[ `command -v pub` ]]; then
7+
pub "$@"
8+
elif [[ `command -v pub.bat` ]]; then
9+
pub.bat "$@"
10+
else
11+
dart pub "$@"
12+
fi

0 commit comments

Comments
 (0)