Skip to content

Commit 49c323a

Browse files
committed
Merge remote-tracking branch 'origin/master' into mmosca-msp-gps-ublox-command
2 parents aac4cd4 + a42af76 commit 49c323a

File tree

181 files changed

+7822
-2574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+7822
-2574
lines changed

.github/workflows/ci.yml

+29-20
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@ name: Build firmware
22
# Don't enable CI on push, just on PR. If you
33
# are working on the main repo and want to trigger
44
# a CI build submit a draft PR.
5-
on: pull_request
5+
on:
6+
pull_request:
7+
paths:
8+
- 'src/**'
9+
- '.github/**'
10+
- 'cmake/**'
11+
- 'lib/**'
12+
- 'docs/Settings.md'
13+
- 'CMakeLists.txt'
14+
- '*.sh'
615

716
jobs:
817
build:
918
runs-on: ubuntu-latest
1019
strategy:
1120
matrix:
12-
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
21+
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1322

1423
steps:
15-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
1625
- name: Install dependencies
1726
run: sudo apt-get update && sudo apt-get -y install ninja-build
1827
- name: Setup environment
@@ -31,22 +40,22 @@ jobs:
3140
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
3241
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
3342
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
34-
- uses: actions/cache@v1
43+
- uses: actions/cache@v4
3544
with:
3645
path: downloads
3746
key: ${{ runner.os }}-downloads-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('**/cmake/*')}}
3847
- name: Build targets (${{ matrix.id }})
39-
run: mkdir -p build && cd build && cmake -DWARNINGS_AS_ERRORS=ON -DCI_JOB_INDEX=${{ matrix.id }} -DCI_JOB_COUNT=${{ strategy.job-total }} -DBUILD_SUFFIX=${{ env.BUILD_SUFFIX }} -G Ninja .. && ninja ci
48+
run: mkdir -p build && cd build && cmake -DWARNINGS_AS_ERRORS=ON -DCI_JOB_INDEX=${{ matrix.id }} -DCI_JOB_COUNT=${{ strategy.job-total }} -DBUILD_SUFFIX=${{ env.BUILD_SUFFIX }} -DMAIN_COMPILE_OPTIONS=-pipe -G Ninja .. && ninja -j4 ci
4049
- name: Upload artifacts
41-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
4251
with:
43-
name: ${{ env.BUILD_NAME }}
52+
name: ${{ env.BUILD_NAME }}.${{ matrix.id }}
4453
path: ./build/*.hex
4554

4655
build-SITL-Linux:
4756
runs-on: ubuntu-latest
4857
steps:
49-
- uses: actions/checkout@v3
58+
- uses: actions/checkout@v4
5059
- name: Install dependencies
5160
run: sudo apt-get update && sudo apt-get -y install ninja-build
5261
- name: Setup environment
@@ -66,17 +75,17 @@ jobs:
6675
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
6776
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
6877
- name: Build SITL
69-
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja
78+
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja -j4
7079
- name: Upload artifacts
71-
uses: actions/upload-artifact@v3
80+
uses: actions/upload-artifact@v4
7281
with:
73-
name: ${{ env.BUILD_NAME }}_SITL
82+
name: ${{ env.BUILD_NAME }}_SITL-Linux
7483
path: ./build_SITL/*_SITL
7584

7685
build-SITL-Mac:
7786
runs-on: macos-latest
7887
steps:
79-
- uses: actions/checkout@v3
88+
- uses: actions/checkout@v4
8089
- name: Install dependencies
8190
run: |
8291
brew install cmake ninja ruby
@@ -100,11 +109,11 @@ jobs:
100109
- name: Build SITL
101110
run: |
102111
mkdir -p build_SITL && cd build_SITL
103-
cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja ..
104-
ninja
112+
cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -G Ninja ..
113+
ninja -j3
105114
106115
- name: Upload artifacts
107-
uses: actions/upload-artifact@v3
116+
uses: actions/upload-artifact@v4
108117
with:
109118
name: ${{ env.BUILD_NAME }}_SITL-MacOS
110119
path: ./build_SITL/*_SITL
@@ -115,7 +124,7 @@ jobs:
115124
run:
116125
shell: C:\tools\cygwin\bin\bash.exe -o igncr '{0}'
117126
steps:
118-
- uses: actions/checkout@v3
127+
- uses: actions/checkout@v4
119128
- name: Setup Cygwin
120129
uses: egor-tensin/setup-cygwin@v4
121130
with:
@@ -137,19 +146,19 @@ jobs:
137146
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
138147
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
139148
- name: Build SITL
140-
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja
149+
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja -j4
141150
- name: Upload artifacts
142-
uses: actions/upload-artifact@v3
151+
uses: actions/upload-artifact@v4
143152
with:
144153
name: ${{ env.BUILD_NAME }}_SITL-WIN
145154
path: ./build_SITL/*.exe
146155

147156

148157
test:
149-
needs: [build]
158+
#needs: [build]
150159
runs-on: ubuntu-latest
151160
steps:
152-
- uses: actions/checkout@v3
161+
- uses: actions/checkout@v4
153162
- name: Install dependencies
154163
run: sudo apt-get update && sudo apt-get -y install ninja-build
155164
- name: Run Tests

.github/workflows/dev-builds.yml

+243
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
name: Build pre-release
2+
# Don't enable CI on push, just on PR. If you
3+
# are working on the main repo and want to trigger
4+
# a CI build submit a draft PR.
5+
on:
6+
push:
7+
branches:
8+
- master
9+
paths:
10+
- 'src/**'
11+
- '.github/**'
12+
- 'cmake/**'
13+
- 'lib/**'
14+
- 'docs/Settings.md'
15+
- 'CMakeLists.txt'
16+
- '*.sh'
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Install dependencies
28+
run: sudo apt-get update && sudo apt-get -y install ninja-build
29+
- name: Setup environment
30+
env:
31+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
32+
run: |
33+
# This is the hash of the commit for the PR
34+
# when the action is triggered by PR, empty otherwise
35+
COMMIT_ID=${{ github.event.pull_request.head.sha }}
36+
# This is the hash of the commit when triggered by push
37+
# but the hash of refs/pull/<n>/merge, which is different
38+
# from the hash of the latest commit in the PR, that's
39+
# why we try github.event.pull_request.head.sha first
40+
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
41+
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
42+
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
43+
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
44+
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
45+
- uses: actions/cache@v4
46+
with:
47+
path: downloads
48+
key: ${{ runner.os }}-downloads-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('**/cmake/*')}}
49+
- name: Build targets (${{ matrix.id }})
50+
run: mkdir -p build && cd build && cmake -DWARNINGS_AS_ERRORS=ON -DCI_JOB_INDEX=${{ matrix.id }} -DCI_JOB_COUNT=${{ strategy.job-total }} -DBUILD_SUFFIX=${{ env.BUILD_SUFFIX }} -DVERSION_TYPE=dev -G Ninja .. && ninja ci
51+
- name: Upload artifacts
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: ${{ env.BUILD_NAME }}.${{ matrix.id }}
55+
path: ./build/*.hex
56+
57+
build-SITL-Linux:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- name: Install dependencies
62+
run: sudo apt-get update && sudo apt-get -y install ninja-build
63+
- name: Setup environment
64+
env:
65+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
66+
run: |
67+
# This is the hash of the commit for the PR
68+
# when the action is triggered by PR, empty otherwise
69+
COMMIT_ID=${{ github.event.pull_request.head.sha }}
70+
# This is the hash of the commit when triggered by push
71+
# but the hash of refs/pull/<n>/merge, which is different
72+
# from the hash of the latest commit in the PR, that's
73+
# why we try github.event.pull_request.head.sha first
74+
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
75+
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
76+
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
77+
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
78+
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
79+
- name: Build SITL
80+
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja -DVERSION_TYPE=dev .. && ninja
81+
- name: Upload artifacts
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: sitl-${{ env.BUILD_NAME }}-Linux
85+
path: ./build_SITL/*_SITL
86+
87+
build-SITL-Mac:
88+
runs-on: macos-latest
89+
steps:
90+
- uses: actions/checkout@v4
91+
- name: Install dependencies
92+
run: |
93+
brew install cmake ninja ruby
94+
95+
- name: Setup environment
96+
env:
97+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
98+
run: |
99+
# This is the hash of the commit for the PR
100+
# when the action is triggered by PR, empty otherwise
101+
COMMIT_ID=${{ github.event.pull_request.head.sha }}
102+
# This is the hash of the commit when triggered by push
103+
# but the hash of refs/pull/<n>/merge, which is different
104+
# from the hash of the latest commit in the PR, that's
105+
# why we try github.event.pull_request.head.sha first
106+
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
107+
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
108+
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
109+
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
110+
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
111+
- name: Build SITL
112+
run: |
113+
mkdir -p build_SITL && cd build_SITL
114+
cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DVERSION_TYPE=dev -G Ninja ..
115+
ninja
116+
117+
- name: Upload artifacts
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: sitl-${{ env.BUILD_NAME }}-MacOS
121+
path: ./build_SITL/*_SITL
122+
123+
build-SITL-Windows:
124+
runs-on: windows-latest
125+
defaults:
126+
run:
127+
shell: C:\tools\cygwin\bin\bash.exe -o igncr '{0}'
128+
steps:
129+
- uses: actions/checkout@v4
130+
- name: Setup Cygwin
131+
uses: egor-tensin/setup-cygwin@v4
132+
with:
133+
packages: cmake ruby ninja gcc-g++
134+
- name: Setup environment
135+
env:
136+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
137+
run: |
138+
# This is the hash of the commit for the PR
139+
# when the action is triggered by PR, empty otherwise
140+
COMMIT_ID=${{ github.event.pull_request.head.sha }}
141+
# This is the hash of the commit when triggered by push
142+
# but the hash of refs/pull/<n>/merge, which is different
143+
# from the hash of the latest commit in the PR, that's
144+
# why we try github.event.pull_request.head.sha first
145+
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
146+
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
147+
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
148+
#echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
149+
#echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
150+
#echo "VERSION_TAG=-$(date '+%Y%m%d')" >> $GITHUB_ENV
151+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
152+
- name: Build SITL
153+
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DVERSION_TYPE=dev -G Ninja .. && ninja
154+
- name: Upload artifacts
155+
uses: actions/upload-artifact@v4
156+
with:
157+
name: sitl-${{ env.BUILD_NAME }}-WIN
158+
path: ./build_SITL/*.exe
159+
160+
161+
test:
162+
runs-on: ubuntu-latest
163+
steps:
164+
- uses: actions/checkout@v4
165+
- name: Install dependencies
166+
run: sudo apt-get update && sudo apt-get -y install ninja-build
167+
- name: Run Tests
168+
run: mkdir -p build && cd build && cmake -DTOOLCHAIN=none -G Ninja .. && ninja check
169+
170+
release:
171+
needs: [build, build-SITL-Linux, build-SITL-Mac, build-SITL-Windows, test]
172+
runs-on: ubuntu-latest
173+
steps:
174+
- uses: actions/checkout@v4
175+
- name: Get version
176+
id: version
177+
run: |
178+
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
179+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
180+
- name: Get current date
181+
id: date
182+
run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
183+
- name: download artifacts
184+
uses: actions/download-artifact@v4
185+
with:
186+
path: hexes
187+
pattern: inav-*
188+
merge-multiple: true
189+
- name: download sitl linux
190+
uses: actions/download-artifact@v4
191+
with:
192+
path: resources/sitl/linux
193+
pattern: sitl-*-Linux
194+
merge-multiple: true
195+
- name: download sitl windows
196+
uses: actions/download-artifact@v4
197+
with:
198+
path: resources/sitl/windows
199+
pattern: sitl-*-WIN
200+
merge-multiple: true
201+
- name: download sitl mac
202+
uses: actions/download-artifact@v4
203+
with:
204+
path: resources/sitl/macos
205+
pattern: sitl-*-MacOS
206+
merge-multiple: true
207+
- name: Consolidate sitl files
208+
run: |
209+
zip -r -9 sitl-resources.zip resources/
210+
- name: Upload release artifacts
211+
uses: softprops/action-gh-release@v2
212+
with:
213+
name: inav-${{ steps.version.outputs.version }}-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }}
214+
tag_name: v${{ steps.version.outputs.version }}-${{ steps.date.outputs.today }}.${{ github.run_number }}
215+
# To create release on a different repo, we need a token setup
216+
token: ${{ secrets.NIGHTLY_TOKEN }}
217+
repository: iNavFlight/inav-nightly
218+
prerelease: true
219+
draft: false
220+
#generate_release_notes: true
221+
make_latest: false
222+
files: |
223+
hexes/*.hex
224+
sitl-resources.zip
225+
body: |
226+
${{ steps.notes.outputs.notes }}
227+
228+
### Flashing
229+
These are nightly builds and configuration settings can be added and removed often. Flashing with Full chip erase is strongly recommended to avoid issues.
230+
Firmware related issues should be opened in the iNavflight/inav repository, not in inav-nightly.
231+
232+
### Repository:
233+
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
234+
235+
### Branch:
236+
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
237+
238+
### Latest changeset:
239+
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
240+
241+
### Changes:
242+
${{ github.event.head_commit.message }}
243+

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Install dependencies
1919
run: sudo apt-get update && sudo apt-get -y install python3-yaml
2020
- name: Check that Settings.md is up to date

0 commit comments

Comments
 (0)