-
Notifications
You must be signed in to change notification settings - Fork 35
193 lines (182 loc) · 8.33 KB
/
unittest.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
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
name: unittest
on:
release:
types: [created, prereleased, published]
workflow_dispatch: null
pull_request: null
jobs:
unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: prepare env
run: |
echo "TRAVIS_BUILD_DIR=$PWD" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=$PWD/tests/install" >> $GITHUB_ENV
echo "GTEST_ROOT=$CMAKE_PREFIX_PATH/googletest" >> $GITHUB_ENV
- name: Install tools
run: |
echo "::group::googletest"
export CMAKE_PREFIX_PATH=$PWD/tests/install
cd $GITHUB_WORKSPACE/tests/ci
export GTEST_ROOT=$CMAKE_PREFIX_PATH/googletest
./install_googletest.sh
echo "::endgroup::"
echo "::group::rapidassist"
cd $GITHUB_WORKSPACE/tests/ci
./install_rapidassist.sh
echo "::endgroup::"
echo "::group::win32arduino"
cd $GITHUB_WORKSPACE/tests/ci
./build_win32arduino.sh
echo "::endgroup::"
echo "::group::build signalDecoderTest"
cd $GITHUB_WORKSPACE/tests/ci
./build_signalDecoderTests.sh
cd $GITHUB_WORKSPACE/
ls -l
echo "::endgroup::"
- name: run test
run: |
cd $GITHUB_WORKSPACE/tests/build
ls -l
./bin/TestProject
deploy:
needs: unittest
strategy:
fail-fast: false
matrix:
include:
- BOARD: nano
RECEIVER: cc1101
arduino-platform: 'arduino:avr'
fqbn: 'arduino:avr:nano:cpu=atmega328'
compilerflag: '\"-DOTHER_BOARD_WITH_CC1101=1\"'
- BOARD: nano328
RECEIVER: ""
arduino-platform: 'arduino:avr'
fqbn: 'arduino:avr:nano:cpu=atmega328'
- BOARD: radino
RECEIVER: cc1101
arduino-platform: 'arduino:avr In-Circuit:avr'
fqbn: 'In-Circuit:avr:radinoCC1101'
boardurl: '--additional-urls=https://library.radino.cc/Arduino_1_8/package_radino_radino32_index.json'
compilerflag: \"-DARDUINO_RADINOCC1101=1\"
build_param1: "compiler.path={runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path}/bin/"
- BOARD: minicul
RECEIVER: cc1101
arduino-platform: 'arduino:avr'
fqbn: 'arduino:avr:pro:cpu=8MHzatmega328'
compilerflag: \"-DARDUINO_ATMEGA328P_MINICUL=1\"
- BOARD: promini
RECEIVER: ""
arduino-platform: 'arduino:avr'
fqbn: 'arduino:avr:pro:cpu=8MHzatmega328'
- BOARD: ESP32
RECEIVER: cc1101
arduino-platform: 'esp32:esp32'
fqbn: 'esp32:esp32:esp32:FlashMode=qio,FlashFreq=80'
compilerflag: \"-DOTHER_BOARD_WITH_CC1101=1\"
boardurl: '--additional-urls=https://dl.espressif.com/dl/package_esp32_index.json'
- BOARD: ESP32
RECEIVER: ""
arduino-platform: 'esp32:esp32'
fqbn: 'esp32:esp32:esp32:FlashMode=qio,FlashFreq=80'
boardurl: '--additional-urls=https://dl.espressif.com/dl/package_esp32_index.json'
- BOARD: ESP8266
RECEIVER: cc1101
arduino-platform: 'esp8266:[email protected]'
fqbn: 'esp8266:esp8266:generic:xtal=80,eesz=1M64,FlashMode=qio,FlashFreq=40'
compilerflag: \"-DOTHER_BOARD_WITH_CC1101=1\"
boardurl: '--additional-urls=https://arduino.esp8266.com/stable/package_esp8266com_index.json'
- BOARD: ESP8266
RECEIVER: ""
arduino-platform: 'esp8266:[email protected]'
fqbn: 'esp8266:esp8266:generic:xtal=80,eesz=1M64,FlashMode=qio,FlashFreq=40'
boardurl: '--additional-urls=https://arduino.esp8266.com/stable/package_esp8266com_index.json'
- BOARD: MAPLEMINI_F103CB
RECEIVER: cc1101
arduino-platform: 'STM32:stm32'
fqbn: 'STM32:stm32:GenF1:pnum=MAPLEMINI_F103CB'
compilerflag: \"-DOTHER_BOARD_WITH_CC1101=1\"
boardurl: '--additional-urls=https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json'
- BOARD: MAPLEMINI_F103CB
RECEIVER: ""
arduino-platform: 'STM32:stm32'
fqbn: 'STM32:stm32:GenF1:pnum=MAPLEMINI_F103CB'
boardurl: '--additional-urls=https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Arduino CLI
uses: arduino/[email protected]
- name: Setup arduino-cli
uses: ./.github/actions/arduino-cli
with:
boardurl: ${{ matrix.boardurl }}
plattform: ${{ matrix.arduino-platform }}
- name: Compile sketch
id: compile_sketch
run: |
export COMPILE_OUTPUT=$(arduino-cli compile --fqbn ${{ matrix.fqbn }} --build-property="compiler.cpp.extra_flags=${{ matrix.compilerflag }}" ${{ matrix.boardurl }} --build-property="${{ matrix.build_param1 }}" --output-dir=$GITHUB_WORKSPACE $GITHUB_WORKSPACE/src/arduino-ide/SIGNALDuino/SIGNALDuino.ino)
echo "$COMPILE_OUTPUT"
echo "fileext=$(test -f $GITHUB_WORKSPACE/SIGNALDuino.ino.bin && echo "bin" || echo "hex")" >> $GITHUB_OUTPUT
echo "skechsize=$(echo "$COMPILE_OUTPUT" | grep -Po "(?<=^Sketch uses )\d+")" >> $GITHUB_OUTPUT
echo "globalramusage=$(echo "$COMPILE_OUTPUT" | grep -Po "(?<=^Global variables use )\d+")" >> $GITHUB_OUTPUT
- name: Get flash and ram usage
id: compile_sizes
run: |
echo Flash usage: ${{ steps.compile_sketch.outputs.skechsize }} bytes
echo Ram usage: ${{ steps.compile_sketch.outputs.globalramusage }} bytes
- name: Find Comment
if: ${{ github.event.pull_request.number > 0 }}
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: ${{ github.sha }}
- name: Create comment
if: ${{ github.event.pull_request.number > 0 && steps.fc.outputs.comment-id == 0 }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
### Size report for commit: ${{ github.sha }}
| Board | Flash | Ram |
|-------|-------|-----|
| ${{ matrix.BOARD }}${{ matrix.RECEIVER }} | ${{ steps.compile_sketch.outputs.skechsize }} bytes | ${{ steps.compile_sketch.outputs.globalramusage }} bytes |
- name: Update comment
if: ${{ github.event.pull_request.number > 0 && steps.fc.outputs.comment-id != 0 }}
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
| ${{ matrix.BOARD }}${{ matrix.RECEIVER }} | ${{ steps.compile_sketch.outputs.skechsize }} bytes | ${{ steps.compile_sketch.outputs.globalramusage }} bytes |
- name: Get release
id: get_release
if: ${{ github.event_name == 'release'}}
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Release Asset
id: upload-release-asset
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./SIGNALDuino.ino.${{ steps.compile_sketch.outputs.fileext }}
asset_name: SIGNALDuino_${{ matrix.BOARD }}${{ matrix.RECEIVER }}_${{ github.event.release.tag_name }}.hex
asset_content_type: application/octet-stream
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: SIGNALDuino_${{ matrix.BOARD }}${{ matrix.RECEIVER }}.hex
path: ./SIGNALDuino.ino.${{ steps.compile_sketch.outputs.fileext }}
if-no-files-found: warn