-
Notifications
You must be signed in to change notification settings - Fork 124
117 lines (110 loc) · 4.08 KB
/
dart.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Build and test
# Avoid duplicate builds for pull requests, allow manual trigger.
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
# Minimal access by default
permissions:
contents: read
jobs:
generator:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
# Prefer running on Ubuntu over Dart Docker image
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 # v1.6.5
with:
sdk: 3.5.2
- name: Install ObjectBox C library
run: ./install.sh --install # Install globally for generator integration tests
- name: Integration test
run: ./generator/test.sh
# make sure the init script doesn't stop working - it's not something we usually run during normal development
init-script:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2.16.0
with:
flutter-version: 3.24.2
cache: true
- run: ./tool/init.sh
lib:
strategy:
fail-fast: false # To see all Dart SDKs that fail, also sometimes with more helpful errors.
matrix:
os:
- windows-2022
- macos-13
- ubuntu-24.04
sdk:
# Always include lowest supported version (see sdk key in objectbox and generator
# pubspec.yaml, but may be higher due to dependencies).
- 3.5.2
- 3.4.4
- 2.18.6
runs-on: ${{ matrix.os }}
steps:
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 # v1.6.5
with:
sdk: ${{ matrix.sdk }}
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Generator Test
working-directory: generator
run: |
../tool/pub.sh get
../tool/pub.sh run test
- name: Install ObjectBox C library
working-directory: objectbox_test
run: ../install.sh
- name: Library Test
working-directory: objectbox_test
# Set concurrency=1 to run only one test suite (== test file) at a time to make it easier to
# attribute native logs. Note that on GitHub Actions this currently makes no difference as
# Dart defaults to concurrency=1.
# Run again with OBX_IN_MEMORY=true using in-memory database.
run: |
../tool/pub.sh get
../tool/pub.sh run build_runner build
../tool/pub.sh run test --concurrency=1
export OBX_IN_MEMORY=true
../tool/pub.sh run test --concurrency=1
flutter-integration-test:
strategy:
fail-fast: false
matrix:
os:
- macos-13
- ubuntu-24.04
- windows-2022 # Flutter 2.9 and newer need Visual Studio 2022 to build desktop.
flutter-version:
# Include lowest working version (use lowest tested Dart SDK as a guideline, see lib tests
# above; but may be higher due to dependency conflicts)
# https://docs.flutter.dev/development/tools/sdk/releases lists included Dart SDK.
- 3.24.2
- 3.7.12
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2.16.0
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
# windows-2022 defaults to Java 8, but Android Plugin requires at least 11.
- uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
with:
distribution: 'temurin'
java-version: '17'
- run: echo $PATH
- run: flutter --version
# https://docs.flutter.dev/desktop#additional-linux-requirements
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: ./tool/apt-install.sh ninja-build pkg-config libgtk-3-dev
- run: make integration-test
working-directory: objectbox