-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (105 loc) · 3.06 KB
/
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
---
name: ci
on:
push:
paths-ignore:
- "README.md"
- "LICENSE"
- "docs/**"
branches:
- master
pull_request:
types: [opened, reopened, synchronize]
branches:
- master
jobs:
lint:
name: static analysis
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v4
- name: update and install apt dependancies
run: |
sudo apt update -y
sudo apt install -y clang-format
echo `clang-format --version`
env:
DEBIAN_FRONTEND: noninteractive
- name: run clang formatter
run: find src include -iname *.c -o -iname *.h | xargs clang-format -n -Werror
build:
name: build firmware
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v3
- name: install gcc-arm-none-eabi & openocd
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-arm-none-eabi openocd
env:
DEBIAN_FRONTEND: noninteractive
- name: setup cmake
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.22.x'
- name: build
run: |
mkdir $GITHUB_WORKSPACE/build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=Off
make -j`nproc`
- name: binary size details
working-directory: build
run: make size
- name: binary object dump
working-directory: build
run: make objdump
- name: archive compile commands
uses: actions/upload-artifact@v3
with:
name: compile_commands.json
path: build/compile_commands.json
retention-days: 5
- name: archive binary
uses: actions/upload-artifact@v3
with:
name: raptor
# relative to $GITHUB_WORKSPACE
path: build/raptor.elf
retention-days: 5
# test:
# name: tests
# runs-on: ubuntu-latest
# steps:
# - name: checkout source
# uses: actions/checkout@v4
# - name: install gcc-arm-none-eabi & openocd
# run: |
# sudo apt-get update -y
# sudo apt-get install -y gcc-arm-none-eabi openocd
# env:
# DEBIAN_FRONTEND: noninteractive
# - name: setup cmake
# uses: jwlawson/actions-setup-cmake@v1.14
# with:
# cmake-version: '3.22.x'
# - name: build integration test binaries
# run: |
# mkdir $GITHUB_WORKSPACE/build
# cd build
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=On
# make -j`nproc`
# - name: build unittests
# run: |
# mkdir $GITHUB_WORKSPACE/tests/unit/build
# cmake -B tests/unit/build -S tests/unit
# cmake --build tests/unit/build
# - name: run unittests
# run: ctest --test-dir tests/unit/build
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v4.0.1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# slug: dronectl/raptor