ci.yml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. name: Continuous Integration
  2. on: [push, pull_request]
  3. jobs:
  4. lint:
  5. name: Lint
  6. runs-on: ubuntu-20.04
  7. steps:
  8. - name: Install
  9. run: sudo apt-get install -y clang-format
  10. - name: Checkout
  11. uses: actions/checkout@v3
  12. - name: Symlinks
  13. run: find * -type l -printf "::error::%p is a symlink. This is forbidden by the Arduino Library Specification." -exec false {} +
  14. - name: Clang-format
  15. run: |
  16. find src/ extras/ -name '*.[ch]pp' | xargs clang-format -i --verbose --style=file
  17. git diff --exit-code
  18. - name: Check URLs
  19. run: |
  20. grep -hREo "(http|https)://[a-zA-Z0-9./?=_%:-]*" src/ | sort -u | while read -r URL
  21. do
  22. STATUS=$(curl -s -o /dev/null -I -w "%{http_code}" "$URL")
  23. [ "$STATUS" -ge 400 ] && echo "::warning title=HTTP $STATUS::$URL returned $STATUS"
  24. done || true
  25. gcc:
  26. name: GCC
  27. needs: lint
  28. runs-on: ubuntu-22.04
  29. strategy:
  30. fail-fast: false
  31. matrix:
  32. include:
  33. - gcc: "5"
  34. - gcc: "6"
  35. - gcc: "7"
  36. cxxflags: -fsanitize=leak -fno-sanitize-recover=all
  37. - gcc: "8"
  38. cxxflags: -fsanitize=undefined -fno-sanitize-recover=all
  39. - gcc: "9"
  40. cxxflags: -fsanitize=address -fno-sanitize-recover=all
  41. - gcc: "10"
  42. cxxflags: -funsigned-char # Issue #1715
  43. - gcc: "11"
  44. - gcc: "12"
  45. steps:
  46. - name: Install
  47. run: |
  48. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 3B4FE6ACC0B21F32
  49. sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic main universe'
  50. sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ focal main universe'
  51. sudo apt-get update
  52. sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
  53. - name: Checkout
  54. uses: actions/checkout@v3
  55. - name: Configure
  56. run: cmake -DCMAKE_BUILD_TYPE=Debug .
  57. env:
  58. CC: gcc-${{ matrix.gcc }}
  59. CXX: g++-${{ matrix.gcc }}
  60. CXXFLAGS: ${{ matrix.cxxflags }}
  61. - name: Build
  62. run: cmake --build .
  63. - name: Test
  64. run: |
  65. echo "## CTest output" >> $GITHUB_STEP_SUMMARY
  66. echo '```' >> $GITHUB_STEP_SUMMARY
  67. ctest --output-on-failure -C Debug . | tee -a $GITHUB_STEP_SUMMARY
  68. echo '```' >> $GITHUB_STEP_SUMMARY
  69. env:
  70. UBSAN_OPTIONS: print_stacktrace=1
  71. clang:
  72. name: Clang
  73. needs: lint
  74. strategy:
  75. fail-fast: false
  76. matrix:
  77. include:
  78. - clang: "3.9"
  79. runner: ubuntu-20.04
  80. archive: bionic
  81. - clang: "4.0"
  82. runner: ubuntu-20.04
  83. archive: bionic
  84. - clang: "5.0"
  85. runner: ubuntu-20.04
  86. archive: bionic
  87. - clang: "6.0"
  88. runner: ubuntu-20.04
  89. archive: bionic
  90. - clang: "7"
  91. runner: ubuntu-20.04
  92. - clang: "8"
  93. cxxflags: -fsanitize=leak -fno-sanitize-recover=all
  94. runner: ubuntu-20.04
  95. - clang: "9"
  96. cxxflags: -fsanitize=undefined -fno-sanitize-recover=all
  97. runner: ubuntu-20.04
  98. - clang: "10"
  99. cxxflags: -fsanitize=address -fno-sanitize-recover=all
  100. runner: ubuntu-20.04
  101. - clang: "11"
  102. runner: ubuntu-22.04
  103. - clang: "12"
  104. runner: ubuntu-22.04
  105. - clang: "13"
  106. runner: ubuntu-22.04
  107. - clang: "14"
  108. runner: ubuntu-22.04
  109. - clang: "15"
  110. runner: ubuntu-22.04
  111. runs-on: ${{ matrix.runner }}
  112. steps:
  113. - name: Add archive repositories
  114. if: matrix.archive
  115. run: |
  116. sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ ${{ matrix.archive }} main'
  117. sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ ${{ matrix.archive }} universe'
  118. - name: Install Clang ${{ matrix.clang }}
  119. run: |
  120. sudo apt-get update
  121. sudo apt-get install -y clang-${{ matrix.clang }}
  122. - name: Install libc++ ${{ matrix.clang }}
  123. if: matrix.clang >= 11
  124. run: sudo apt-get install -y libc++-${{ matrix.clang }}-dev libc++abi-${{ matrix.clang }}-dev
  125. - name: Install libunwind ${{ matrix.clang }}
  126. if: matrix.clang == 12 # dependency is missing in Ubuntu 22.04
  127. run: sudo apt-get install -y libunwind-${{ matrix.clang }}-dev
  128. - name: Checkout
  129. uses: actions/checkout@v3
  130. - name: Configure
  131. run: cmake -DCMAKE_BUILD_TYPE=Debug .
  132. env:
  133. CC: clang-${{ matrix.clang }}
  134. CXX: clang++-${{ matrix.clang }}
  135. CXXFLAGS: >-
  136. ${{ matrix.cxxflags }}
  137. ${{ matrix.clang < 11 && '-I/usr/lib/llvm-10/include/c++/v1/' || '' }}
  138. - name: Build
  139. run: cmake --build .
  140. - name: Test
  141. run: |
  142. echo "## CTest output" >> $GITHUB_STEP_SUMMARY
  143. echo '```' >> $GITHUB_STEP_SUMMARY
  144. ctest --output-on-failure -C Debug . | tee -a $GITHUB_STEP_SUMMARY
  145. echo '```' >> $GITHUB_STEP_SUMMARY
  146. env:
  147. UBSAN_OPTIONS: print_stacktrace=1
  148. conf_test:
  149. name: Test configuration on Linux
  150. needs: [gcc, clang]
  151. runs-on: ubuntu-20.04
  152. steps:
  153. - name: Install
  154. run: |
  155. sudo apt-get update
  156. sudo apt-get install -y g++-multilib gcc-avr avr-libc
  157. - name: Checkout
  158. uses: actions/checkout@v3
  159. - name: AVR
  160. run: avr-g++ -std=c++11 -Isrc extras/conf_test/avr.cpp
  161. - name: GCC 32-bit
  162. run: g++ -std=c++11 -m32 -Isrc extras/conf_test/x86.cpp
  163. - name: GCC 64-bit
  164. run: g++ -std=c++11 -m64 -Isrc extras/conf_test/x64.cpp
  165. - name: Clang 32-bit
  166. run: clang++ -std=c++11 -m32 -Isrc extras/conf_test/x86.cpp
  167. - name: Clang 64-bit
  168. run: clang++ -std=c++11 -m64 -Isrc extras/conf_test/x64.cpp
  169. conf_test_windows:
  170. name: Test configuration on Windows
  171. runs-on: windows-2019
  172. needs: [gcc, clang]
  173. steps:
  174. - name: Checkout
  175. uses: actions/checkout@v3
  176. - name: 32-bit
  177. run: |
  178. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
  179. cl /Isrc extras/conf_test/x86.cpp
  180. shell: cmd
  181. - name: 64-bit
  182. run: |
  183. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  184. cl /Isrc extras/conf_test/x64.cpp
  185. shell: cmd
  186. xcode:
  187. name: XCode
  188. needs: clang
  189. runs-on: macos-11
  190. strategy:
  191. fail-fast: false
  192. matrix:
  193. include:
  194. - xcode: "11.7"
  195. - xcode: "12.4"
  196. - xcode: "13.2.1"
  197. steps:
  198. - name: Checkout
  199. uses: actions/checkout@v3
  200. - name: Select XCode version
  201. run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app
  202. - name: Configure
  203. run: cmake -DCMAKE_BUILD_TYPE=Debug .
  204. - name: Build
  205. run: cmake --build .
  206. - name: Test
  207. run: ctest --output-on-failure -C Debug .
  208. # DISABLED: Running on AppVeyor instead because it supports older versions of the compiler
  209. # msvc:
  210. # name: Visual Studio
  211. # strategy:
  212. # fail-fast: false
  213. # matrix:
  214. # include:
  215. # - os: windows-2016
  216. # - os: windows-2019
  217. # runs-on: ${{ matrix.os }}
  218. # steps:
  219. # - name: Checkout
  220. # uses: actions/checkout@v3
  221. # - name: Configure
  222. # run: cmake -DCMAKE_BUILD_TYPE=Debug .
  223. # - name: Build
  224. # run: cmake --build .
  225. # - name: Test
  226. # run: ctest --output-on-failure -C Debug .
  227. arduino:
  228. name: Arduino
  229. needs: gcc
  230. strategy:
  231. fail-fast: false
  232. matrix:
  233. include:
  234. - core: arduino:avr
  235. board: arduino:avr:uno
  236. - core: arduino:samd
  237. board: arduino:samd:mkr1000
  238. runs-on: ubuntu-20.04
  239. steps:
  240. - name: Checkout
  241. uses: actions/checkout@v3
  242. - name: Install arduino-cli
  243. run: curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
  244. - name: Install core
  245. run: arduino-cli core install ${{ matrix.core }}
  246. - name: Install libraries
  247. run: arduino-cli lib install SD Ethernet
  248. - name: Build JsonConfigFile
  249. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/JsonConfigFile/JsonConfigFile.ino"
  250. - name: Build JsonFilterExample
  251. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/JsonFilterExample/JsonFilterExample.ino"
  252. - name: Build JsonGeneratorExample
  253. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/JsonGeneratorExample/JsonGeneratorExample.ino"
  254. - name: Build JsonHttpClient
  255. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/JsonHttpClient/JsonHttpClient.ino"
  256. - name: Build JsonParserExample
  257. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/JsonParserExample/JsonParserExample.ino"
  258. - name: Build JsonServer
  259. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/JsonServer/JsonServer.ino"
  260. - name: Build JsonUdpBeacon
  261. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/JsonUdpBeacon/JsonUdpBeacon.ino"
  262. - name: Build MsgPackParser
  263. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/MsgPackParser/MsgPackParser.ino"
  264. - name: Build ProgmemExample
  265. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/ProgmemExample/ProgmemExample.ino"
  266. - name: Build StringExample
  267. run: arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/StringExample/StringExample.ino"
  268. platformio:
  269. name: PlatformIO
  270. needs: gcc
  271. runs-on: ubuntu-latest
  272. strategy:
  273. fail-fast: false
  274. matrix:
  275. include:
  276. - platform: atmelavr
  277. board: leonardo
  278. libraries:
  279. - SD
  280. - Ethernet
  281. conf_test: avr
  282. - platform: espressif8266
  283. board: huzzah
  284. conf_test: esp8266
  285. - platform: espressif32
  286. board: esp32dev
  287. libraries:
  288. - Ethernet
  289. conf_test: esp8266
  290. - platform: atmelsam
  291. board: mkr1000USB
  292. libraries:
  293. - SD
  294. - Ethernet
  295. conf_test: esp8266
  296. - platform: teensy
  297. board: teensy31
  298. conf_test: esp8266
  299. - platform: ststm32
  300. board: adafruit_feather_f405
  301. libraries:
  302. - SD
  303. - Ethernet
  304. conf_test: esp8266
  305. - platform: nordicnrf52
  306. board: adafruit_feather_nrf52840
  307. libraries:
  308. - SD
  309. - Ethernet
  310. conf_test: esp8266
  311. steps:
  312. - name: Checkout
  313. uses: actions/checkout@v3
  314. - name: Set up cache for pip
  315. uses: actions/cache@v3
  316. with:
  317. path: ~/.cache/pip
  318. key: ${{ runner.os }}-pip
  319. - name: Set up Python 3.x
  320. uses: actions/setup-python@v4
  321. with:
  322. python-version: "3.x"
  323. - name: Install PlatformIO
  324. run: pip install platformio
  325. - name: Install adafruit-nrfutil
  326. if: ${{ matrix.platform == 'nordicnrf52' }}
  327. run: pip install adafruit-nrfutil
  328. - name: Include Adafruit_TinyUSB.h # https://github.com/adafruit/Adafruit_nRF52_Arduino/issues/653
  329. if: ${{ matrix.platform == 'nordicnrf52' }}
  330. run: find examples/ -name '*.ino' -exec sed -i 's/\(#include <ArduinoJson.h>\)/\1\n#include <Adafruit_TinyUSB.h>/' {} +
  331. - name: Set up cache for platformio
  332. uses: actions/cache@v3
  333. with:
  334. path: ~/.platformio
  335. key: ${{ runner.os }}-platformio-${{ matrix.platform }}
  336. - name: Install platform "${{ matrix.platform }}"
  337. run: platformio platform install ${{ matrix.platform }}
  338. - name: Install libraries
  339. if: ${{ matrix.libraries }}
  340. run: platformio lib install arduino-libraries/${{ join(matrix.libraries, ' arduino-libraries/') }}
  341. - name: Test configuration
  342. run: platformio ci "extras/conf_test/${{ matrix.conf_test }}.cpp" -l '.' -b ${{ matrix.board }}
  343. if: ${{ matrix.conf_test }}
  344. - name: Build JsonConfigFile
  345. run: platformio ci "examples/JsonConfigFile/JsonConfigFile.ino" -l '.' -b ${{ matrix.board }}
  346. - name: Build JsonFilterExample
  347. run: platformio ci "examples/JsonFilterExample/JsonFilterExample.ino" -l '.' -b ${{ matrix.board }}
  348. - name: Build JsonGeneratorExample
  349. run: platformio ci "examples/JsonGeneratorExample/JsonGeneratorExample.ino" -l '.' -b ${{ matrix.board }}
  350. - name: Build JsonHttpClient
  351. run: platformio ci "examples/JsonHttpClient/JsonHttpClient.ino" -l '.' -b ${{ matrix.board }}
  352. - name: Build JsonParserExample
  353. run: platformio ci "examples/JsonParserExample/JsonParserExample.ino" -l '.' -b ${{ matrix.board }}
  354. - name: Build JsonServer
  355. if: ${{ matrix.platform != 'espressif32' }}
  356. run: platformio ci "examples/JsonServer/JsonServer.ino" -l '.' -b ${{ matrix.board }}
  357. - name: Build JsonUdpBeacon
  358. run: platformio ci "examples/JsonUdpBeacon/JsonUdpBeacon.ino" -l '.' -b ${{ matrix.board }}
  359. - name: Build MsgPackParser
  360. run: platformio ci "examples/MsgPackParser/MsgPackParser.ino" -l '.' -b ${{ matrix.board }}
  361. - name: Build ProgmemExample
  362. run: platformio ci "examples/ProgmemExample/ProgmemExample.ino" -l '.' -b ${{ matrix.board }}
  363. - name: Build StringExample
  364. run: platformio ci "examples/StringExample/StringExample.ino" -l '.' -b ${{ matrix.board }}
  365. - name: PlatformIO prune
  366. if: ${{ always() }}
  367. run: platformio system prune -f
  368. particle:
  369. name: Particle
  370. needs: gcc
  371. runs-on: ubuntu-latest
  372. if: github.event_name == 'push'
  373. strategy:
  374. fail-fast: false
  375. matrix:
  376. include:
  377. - board: argon
  378. steps:
  379. - name: Checkout
  380. uses: actions/checkout@v3
  381. - name: Install Particle CLI
  382. run: sudo npm install -g particle-cli
  383. - name: Login to Particle
  384. run: particle login -t "${{ secrets.PARTICLE_TOKEN }}"
  385. - name: Compile
  386. run: extras/ci/particle.sh ${{ matrix.board }}
  387. arm:
  388. name: GCC for ARM processor
  389. needs: gcc
  390. runs-on: ubuntu-20.04
  391. steps:
  392. - name: Install
  393. run: |
  394. sudo apt-get update
  395. sudo apt-get install -y g++-arm-linux-gnueabihf
  396. - name: Checkout
  397. uses: actions/checkout@v3
  398. - name: Configure
  399. run: cmake .
  400. env:
  401. CC: arm-linux-gnueabihf-gcc
  402. CXX: arm-linux-gnueabihf-g++
  403. - name: Build
  404. run: cmake --build .
  405. coverage:
  406. needs: gcc
  407. name: Coverage
  408. runs-on: ubuntu-20.04
  409. steps:
  410. - name: Install
  411. run: sudo apt-get install -y lcov ninja-build
  412. - name: Checkout
  413. uses: actions/checkout@v3
  414. - name: Configure
  415. run: cmake -G Ninja -DCOVERAGE=true .
  416. - name: Build
  417. run: ninja
  418. - name: Test
  419. run: ctest --output-on-failure -LE 'WillFail|Fuzzing' -T test
  420. - name: lcov --capture
  421. run: lcov --capture --no-external --directory . --output-file coverage.info
  422. - name: lcov --remove
  423. run: lcov --remove coverage.info "$(pwd)/extras/*" --output-file coverage_filtered.info
  424. - name: genhtml
  425. run: mkdir coverage && genhtml coverage_filtered.info -o coverage -t ArduinoJson
  426. - name: Upload HTML report
  427. uses: actions/upload-artifact@v3
  428. with:
  429. name: Coverage report
  430. path: coverage
  431. - name: Upload to Coveralls
  432. uses: coverallsapp/github-action@master
  433. with:
  434. github-token: ${{ secrets.GITHUB_TOKEN }}
  435. path-to-lcov: coverage_filtered.info
  436. valgrind:
  437. needs: gcc
  438. name: Valgrind
  439. runs-on: ubuntu-20.04
  440. steps:
  441. - name: Install
  442. run: |
  443. sudo apt-get update
  444. sudo apt-get install -y valgrind ninja-build
  445. - name: Checkout
  446. uses: actions/checkout@v3
  447. - name: Configure
  448. run: cmake -G Ninja -D MEMORYCHECK_COMMAND_OPTIONS="--error-exitcode=1 --leak-check=full" .
  449. - name: Build
  450. run: ninja
  451. - name: Memcheck
  452. run: ctest --output-on-failure -LE WillFail -T memcheck
  453. id: memcheck
  454. - name: MemoryChecker.*.log
  455. run: cat Testing/Temporary/MemoryChecker.*.log
  456. if: failure()
  457. clang-tidy:
  458. needs: clang
  459. name: Clang-Tidy
  460. runs-on: ubuntu-20.04
  461. steps:
  462. - name: Install
  463. run: sudo apt-get install -y clang-tidy cmake ninja-build
  464. - name: Checkout
  465. uses: actions/checkout@v3
  466. - name: Configure
  467. run: cmake -G Ninja -DCMAKE_CXX_CLANG_TIDY="clang-tidy-10;--warnings-as-errors=*" -DCMAKE_BUILD_TYPE=Debug .
  468. env:
  469. CC: clang-10
  470. CXX: clang++-10
  471. - name: Check
  472. run: cmake --build . -- -k 0
  473. amalgamate-h:
  474. needs: gcc
  475. name: Amalgamate ArduinoJson.h
  476. runs-on: ubuntu-20.04
  477. steps:
  478. - name: Checkout
  479. uses: actions/checkout@v3
  480. - name: Amalgamate
  481. id: amalgamate
  482. run: |
  483. if [[ $GITHUB_REF == refs/tags/* ]]; then
  484. VERSION=${GITHUB_REF#refs/tags/}
  485. else
  486. VERSION=${GITHUB_SHA::7}
  487. fi
  488. INPUT=src/ArduinoJson.h
  489. OUTPUT=ArduinoJson-$VERSION.h
  490. extras/scripts/build-single-header.sh "$INPUT" "$OUTPUT"
  491. echo "filename=${OUTPUT}" >> $GITHUB_OUTPUT
  492. - name: Smoke test
  493. run: |
  494. g++ -x c++ - <<END
  495. #include "${{ steps.amalgamate.outputs.filename }}"
  496. int main() {
  497. JsonDocument doc;
  498. deserializeJson(doc, "{}");
  499. }
  500. END
  501. - name: Upload artifact
  502. uses: actions/upload-artifact@v3
  503. with:
  504. name: Single headers
  505. path: ${{ steps.amalgamate.outputs.filename }}
  506. amalgamate-hpp:
  507. needs: gcc
  508. name: Amalgamate ArduinoJson.hpp
  509. runs-on: ubuntu-20.04
  510. steps:
  511. - name: Checkout
  512. uses: actions/checkout@v3
  513. - name: Amalgamate
  514. id: amalgamate
  515. run: |
  516. if [[ $GITHUB_REF == refs/tags/* ]]; then
  517. VERSION=${GITHUB_REF#refs/tags/}
  518. else
  519. VERSION=${GITHUB_SHA::7}
  520. fi
  521. INPUT=src/ArduinoJson.hpp
  522. OUTPUT=ArduinoJson-$VERSION.hpp
  523. extras/scripts/build-single-header.sh "$INPUT" "$OUTPUT"
  524. echo "filename=${OUTPUT}" >> $GITHUB_OUTPUT
  525. - name: Smoke test
  526. run: |
  527. g++ -x c++ - <<END
  528. #include "${{ steps.amalgamate.outputs.filename }}"
  529. int main() {
  530. ArduinoJson::JsonDocument doc;
  531. deserializeJson(doc, "{}");
  532. }
  533. END
  534. - name: Upload artifact
  535. uses: actions/upload-artifact@v3
  536. with:
  537. name: Single headers
  538. path: ${{ steps.amalgamate.outputs.filename }}
  539. esp-idf:
  540. needs: gcc
  541. name: ESP-IDF
  542. runs-on: ubuntu-latest
  543. steps:
  544. - name: Setup cache
  545. uses: actions/cache@v3
  546. with:
  547. path: ~/.espressif
  548. key: ${{ runner.os }}-esp-idf
  549. - name: Checkout ArduinoJson
  550. uses: actions/checkout@v3
  551. - name: Checkout ESP-IDF
  552. uses: actions/checkout@v3
  553. with:
  554. repository: espressif/esp-idf
  555. path: esp-idf
  556. submodules: true
  557. - name: Install ESP-IDF
  558. run: ./esp-idf/install.sh
  559. - name: Add component
  560. # NOTE: we cannot commit the symlink because the Arduino Library Specification forbids it.
  561. run: |
  562. mkdir -p extras/ci/espidf/components
  563. ln -s $PWD extras/ci/espidf/components/ArduinoJson
  564. - name: Build example
  565. run: |
  566. source esp-idf/export.sh
  567. cd extras/ci/espidf
  568. idf.py build
  569. codeql:
  570. name: CodeQL
  571. runs-on: ubuntu-20.04
  572. needs: gcc
  573. permissions:
  574. actions: read
  575. contents: read
  576. security-events: write
  577. steps:
  578. - name: Checkout repository
  579. uses: actions/checkout@v3
  580. - name: Initialize CodeQL
  581. uses: github/codeql-action/init@v2
  582. with:
  583. languages: cpp
  584. - name: Build
  585. run: |
  586. cmake -DCMAKE_BUILD_TYPE=Debug .
  587. cmake --build .
  588. - name: Perform CodeQL Analysis
  589. uses: github/codeql-action/analyze@v2
  590. with:
  591. category: "/language:cpp"