ci.yml 20 KB

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