ci.yml 20 KB

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