-
Notifications
You must be signed in to change notification settings - Fork 9
128 lines (102 loc) · 3.25 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
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
target: aarch64-linux-android
ndk:
version: r25c
abi: arm64-v8a
test-env:
OUISYNC_LIB: ouisync-plugin/ouisync/target/debug/libouisync_ffi.so
build-args: apk --target-platform android-arm64
- name: linux
os: ubuntu-latest
# TODO: enable analysis
# analyze: true
test-env:
OUISYNC_LIB: ouisync-plugin/ouisync/target/debug/libouisync_ffi.so
build-args:
- name: windows
os: windows-latest
test-env:
OUISYNC_LIB: ouisync-plugin\ouisync\target\debug\ouisync_ffi.dll
build-args:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Add rust target
run: rustup target add ${{ matrix.target }}
if: matrix.target != ''
- name: Install libfuse
run: sudo apt-get install libfuse-dev
if: matrix.name != 'windows'
- name: Install dokan
run: choco install dokany
if: matrix.name == 'windows'
- name: Refresh environment after installing dokan
run: |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
if: matrix.name == 'windows'
- name: Print env (debug)
run: "dir env:"
if: matrix.name == 'windows'
- 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 != ''
- name: Generate ./ouisync-plugin/ouisync/target/bindings.h
run: |
cd ouisync-plugin/ouisync
cargo run --package ouisync-bindgen --bin bindgen
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Run Flutter doctor
run: flutter doctor -v
- name: Get Flutter packages
run: dart pub get
- name: Run Flutter code generators
run: dart run build_runner build
env:
DSN:
- name: Generate the Dart bindings for the Ouisync library
run: cd ouisync-plugin && flutter pub run ffigen
- name: Analyze
run: |
cd lib && flutter analyze
cd test && flutter analyze
cd util && flutter analyze
if: matrix.analyze
- name: Build Ouisync library for tests
run: |
cd ouisync-plugin/ouisync
cargo build --package ouisync-ffi
- name: Run tests
run:
flutter test
env: ${{ matrix.test-env }}
- name: Build Ouisync app
run: flutter build ${{ matrix.build-args }}