ci.yml 20 KB

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