-
Notifications
You must be signed in to change notification settings - Fork 130
201 lines (163 loc) · 6.76 KB
/
pathplanner-ci.yaml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: PathPlanner
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
version:
type: string
description: The full version string, i.e. 2024.0.0-alpha-1 or 2024.1.1
required: true
env:
FLUTTER_VERSION: 3.24.4
jobs:
formatting-analysis:
name: "[GUI] Check Formatting & Analysis"
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-path: ${{ runner.tool_cache }}/flutter/linux
- name: Get dependencies
run: flutter pub get
- name: Generate mocks
run: dart run build_runner build
- name: Analyze
run: flutter analyze
- name: Check formatting
run: dart format -o none --set-exit-if-changed lib/* test/*
test:
name: "[GUI] Run Tests"
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-path: ${{ runner.tool_cache }}/flutter/linux
- name: Get dependencies
run: flutter pub get
- name: Generate full coverage test
run: dart run full_coverage
- name: Generate mocks
run: dart run build_runner build
- name: Run tests
run: flutter test --coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: flutter-coverage
files: coverage/lcov.info
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
build-option: "windows"
artifact-path: "build/windows/x64/runner/Release"
artifact-name: PathPlanner-Windows
- os: macos-15
build-option: "macos"
artifact-path: "build/macos/Build/Products/Release/PathPlanner-macOS.zip"
artifact-name: PathPlanner-macOS
- os: ubuntu-22.04
build-option: "linux"
artifact-path: "build/linux/x64/release/bundle"
artifact-name: PathPlanner-Linux
name: "[GUI] Build - ${{ matrix.artifact-name }}"
needs: [formatting-analysis, test]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install flutter deps
if: ${{ matrix.build-option == 'linux' }}
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-path: ${{ runner.tool_cache }}/flutter/${{ matrix.build-option }}
- name: Get dependencies
run: flutter pub get
- name: Set release version env
if: ${{ github.event_name == 'workflow_dispatch' && matrix.build-option != 'windows' }}
run: echo "VERSION_NAME=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Set dev version env
if: ${{ github.event_name != 'workflow_dispatch' && matrix.build-option != 'windows' }}
run: echo "VERSION_NAME=0.0.0-dev-${{ github.run_number }}" >> $GITHUB_ENV
- name: Set release version env windows just has to be different
if: ${{ github.event_name == 'workflow_dispatch' && matrix.build-option == 'windows' }}
run: Add-Content -Path ${env:GITHUB_ENV} -Value "VERSION_NAME=${{ github.event.inputs.version }}"
- name: Set dev version env windows just has to be different
if: ${{ github.event_name != 'workflow_dispatch' && matrix.build-option == 'windows' }}
run: Add-Content -Path ${env:GITHUB_ENV} -Value "VERSION_NAME=0.0.0-dev-${{ github.run_number }}"
- name: Set pubspec version
run: |
flutter pub global activate cider
dart run cider version "${{ env.VERSION_NAME }}+${{ github.run_number }}"
- name: Build app
run: flutter build ${{ matrix.build-option }}
- name: Copy redist
if: ${{ matrix.build-option == 'windows' }}
run: |
cp windows/redist/msvcp140.dll build/windows/x64/runner/Release
cp windows/redist/vcruntime140.dll build/windows/x64/runner/Release
cp windows/redist/vcruntime140_1.dll build/windows/x64/runner/Release
- name: Zip release (macOS)
if: ${{ matrix.build-option == 'macos' }}
run: |
cd build/macos/Build/Products/Release
zip -r PathPlanner-macOS.zip PathPlanner.app --symlinks
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}
path: ${{ matrix.artifact-path }}
- name: Create macOS DMG
if: ${{ matrix.build-option == 'macos' }}
uses: L-Super/create-dmg-actions@v1
with:
dmg_name: build/macos/Build/Products/Release/${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}
src_dir: build/macos/Build/Products/Release/PathPlanner.app
- name: Upload macOS DMG artifact
if: ${{ matrix.build-option == 'macos' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}-dmg
path: build/macos/Build/Products/Release/${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}.dmg
- name: Create windows installer
if: ${{ matrix.build-option == 'windows' }}
uses: Minionguyjpro/Inno-Setup-Action@v1.2.5
with:
path: windows_installer.iss
options: /O+ /F"${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}-setup"
- name: Upload windows installer artifact
if: ${{ matrix.build-option == 'windows' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}-setup
path: build/windows/x64/installer/${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}-setup.exe
- name: Create MSIX
if: ${{ matrix.build-option == 'windows' }}
run: flutter pub run msix:create --store
- name: Upload MSIX artifact
if: ${{ matrix.build-option == 'windows' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}-v${{ env.VERSION_NAME }}-msix
path: ${{ matrix.artifact-path }}/pathplanner.msix