-
Notifications
You must be signed in to change notification settings - Fork 9
134 lines (110 loc) · 3.71 KB
/
ci.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI
on:
push:
paths-ignore:
- '**/README.md'
pull_request:
branches: [master]
jobs:
build_and_test:
name: build and test on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
name: [android, linux, windows]
include:
- name: android
os: ubuntu-latest
env:
OUISYNC_LIB: ouisync/target/debug/libouisync_ffi.so
target: aarch64-linux-android
ndk:
version: r25c
abi: arm64-v8a
build-args: apk --target-platform android-arm64
- name: linux
os: ubuntu-latest
env:
OUISYNC_LIB: ouisync/target/debug/libouisync_ffi.so
# TODO: enable analysis
# analyze: true
build-args: linux
- name: windows
os: windows-latest
env:
# Install Dokan2.dll to where `flutter test` can find it
DOKAN_DLL_OUTPUT_PATH: C:\Windows\System32
OUISYNC_LIB: ouisync\target\debug\ouisync_ffi.dll
build-args: windows
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Add rust target
run: rustup target add ${{ matrix.target }}
if: matrix.target != ''
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
if: matrix.name == 'android'
- name: Install build dependencies (linux)
run: |
# https://github.com/orgs/community/discussions/109146
sudo apt update -y
sudo apt-get install libappindicator3-dev \
libfuse-dev \
libgtk-3-dev \
ninja-build
if: matrix.name == 'linux'
- name: Install build dependencies (android)
# Note that libfuse-dev is not required to build the Android app, but
# later in this CI script we also run tests on Linux which do require
# it.
run: sudo apt-get install libfuse-dev
if: matrix.name == 'android'
- name: Install Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{ matrix.ndk.version }}
if: matrix.ndk.version != ''
- name: Set NDK ABI filter
run: echo "ndk.abiFilters=${{ matrix.ndk.abi }}" >> android/local.properties
if: matrix.ndk.abi != ''
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
# Downgrade flutter from the current 3.24.0 version due to a compilation bug
# in the extended_text dependency.
# https://github.com/fluttercandies/extended_text/issues/166
# TODO: Remove the below line when the above bug is resolved.
flutter-version: 3.22.3
- name: Run Flutter doctor
run: flutter doctor -v
- name: Get Flutter packages
run: dart pub get
- name: Generate the Dart bindings for the Ouisync library
working-directory: ouisync/bindings/dart
run: dart util/bindgen.dart
- name: Analyze
run: |
pushd lib
flutter analyze
popd
pushd test
flutter analyze
popd
pushd util
flutter analyze
popd
if: matrix.analyze
- name: Build Ouisync library for tests
working-directory: ouisync
run: cargo build --package ouisync-ffi --lib
- name: Run tests
run:
flutter test
- name: Build Ouisync app
run: flutter --verbose build ${{ matrix.build-args }}