-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (70 loc) · 1.98 KB
/
build.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
name: Build
on:
push:
# On main, it's the build and release that will run
branches-ignore: [ "main" ]
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
server: ${{ steps.filter.outputs.server }}
app: ${{ steps.filter.outputs.app }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
server:
- 'server/src/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'Cross.toml'
app:
- 'app/**'
server:
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.server == 'true' }}
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash
working-directory: ./server
steps:
- uses: rui314/setup-mold@v1
- uses: actions/checkout@v3
- name: 🌱 - Install project dependencies
run: sudo apt-get update; sudo apt-get install -y libudev-dev libsystemd-dev libusb-1.0-0-dev
- name: 🧯 - Check for compile errors
run: cargo check -q
- name: 🧐 - Lint check
run: cargo clippy -- -D warnings
- name: 🔨 - Build
run: cargo build -q
- name: 🧪 - Run tests
run: cargo test -q
app:
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.app == 'true' }}
defaults:
run:
shell: bash
working-directory: ./app
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: 🌱 - Get dependencies
run: flutter pub get
- name: ⭐ - Verify formatting
run: dart format --output=none --set-exit-if-changed .
- name: 🧐 - Analyze project source
run: dart analyze --fatal-infos
- name: 🧪 - Run tests
run: flutter test
- name: 🔨 - Build
run: flutter build appbundle