Skip to content

Commit e9305c3

Browse files
committed
CI - test all supported platforms and versions
1 parent 9926f85 commit e9305c3

File tree

4 files changed

+68
-37
lines changed

4 files changed

+68
-37
lines changed

.github/workflows/dart.yml

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,62 @@ defaults:
77
shell: bash
88

99
jobs:
10-
generator:
11-
runs-on: ubuntu-20.04
12-
container:
13-
image: google/dart:latest
14-
steps:
15-
- uses: actions/checkout@v1
16-
- name: Install ObjectBox C-API
17-
run: ./install.sh
18-
- name: Run tests
19-
run: ./generator/test.sh
10+
# generator:
11+
# runs-on: ubuntu-20.04
12+
# container:
13+
# image: google/dart:latest
14+
# steps:
15+
# - uses: actions/checkout@v1
16+
# - name: Install ObjectBox C-API
17+
# run: ./install.sh
18+
# - name: Run tests
19+
# 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

35-
valgrind:
36-
runs-on: ubuntu-20.04
37-
container:
38-
image: google/dart:latest
39-
steps:
40-
- uses: actions/checkout@v1
41-
- name: Install ObjectBox C-API
42-
run: ./install.sh
43-
- run: pub get
44-
- name: Generate ObjectBox models
45-
run: pub run build_runner build
46-
- name: Install Valgrind
47-
run: |
48-
apt update
49-
apt install -y valgrind
50-
- run: ./tool/valgrind.sh
53+
# valgrind:
54+
# runs-on: ubuntu-20.04
55+
# container:
56+
# image: google/dart:latest
57+
# steps:
58+
# - uses: actions/checkout@v1
59+
# - name: Install ObjectBox C-API
60+
# run: ./install.sh
61+
# - run: pub get
62+
# - name: Generate ObjectBox models
63+
# run: pub run build_runner build
64+
# - name: Install Valgrind
65+
# run: |
66+
# apt update
67+
# apt install -y valgrind
68+
# - run: ./tool/valgrind.sh

lib/src/query/query.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ class Query<T> {
746746
try {
747747
final idArray = idArrayPtr.ref;
748748
return idArray.count == 0
749-
? List<int>.empty()
749+
? List<int>.filled(0, 0)
750750
: idArray.ids.asTypedList(idArray.count).toList(growable: false);
751751
} finally {
752752
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)