-
Notifications
You must be signed in to change notification settings - Fork 16
125 lines (104 loc) · 3.16 KB
/
Copy pathlinux-build.yml
File metadata and controls
125 lines (104 loc) · 3.16 KB
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
name: Linux Build
on:
push:
branches: [main, develop]
paths:
- 'go_lib/**'
- 'lib/**'
- 'test/**'
- 'linux/**'
- 'images/**'
- 'pubspec.yaml'
- 'analysis_options.yaml'
pull_request:
branches: [main]
paths:
- 'go_lib/**'
- 'lib/**'
- 'test/**'
- 'linux/**'
- 'images/**'
- 'pubspec.yaml'
- 'analysis_options.yaml'
jobs:
test-flutter:
name: Flutter Test & Analyze (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Get dependencies
run: flutter pub get
- name: Static analysis
run: flutter analyze --no-fatal-infos
- name: Run Flutter unit tests
run: flutter test --coverage
build-go:
name: Go Build & Test (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go_lib/go.mod
- name: Build Go shared library
working-directory: go_lib
run: |
CGO_ENABLED=1 go build -buildvcs=false -o botsec.so -buildmode=c-shared .
if [ -f "libbotsec.so" ] && [ ! -f "botsec.so" ]; then
mv libbotsec.so botsec.so
fi
- name: Run Go tests
working-directory: go_lib
run: |
go test -race -v -count=1 -timeout 300s ./...
- name: Upload shared library artifact
uses: actions/upload-artifact@v4
with:
name: botsec-so
path: go_lib/botsec.so
retention-days: 7
build-sandbox-preload:
name: Build Sandbox Preload Library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build libsandbox_preload.so with CMake
run: |
cmake -S go_lib/core/sandbox/linux_hook -B go_lib/core/sandbox/linux_hook/build -DCMAKE_BUILD_TYPE=Release
cmake --build go_lib/core/sandbox/linux_hook/build
- name: Upload preload library artifact
uses: actions/upload-artifact@v4
with:
name: sandbox-preload-so
path: go_lib/core/sandbox/linux_hook/build/libsandbox_preload.so
retention-days: 7
build-flutter:
name: Flutter Build (Linux)
runs-on: ubuntu-latest
needs: [build-go, build-sandbox-preload, test-flutter]
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libayatana-appindicator3-dev
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Download Go shared library artifact
uses: actions/download-artifact@v4
with:
name: botsec-so
path: plugins
- name: Download sandbox preload artifact
uses: actions/download-artifact@v4
with:
name: sandbox-preload-so
path: plugins
- name: Get dependencies
run: flutter pub get
- name: Build Linux app
run: flutter build linux --release --no-tree-shake-icons