diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..df5f0016 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,30 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.py text eol=lf +*.rst text eol=lf +*.sh text eol=lf +*.h text eol=lf +*.cpp text eol=lf +*.c text eol=lf +.yaml text eol=lf +*.yml text eol=lf +*.md text eol=lf +*.txt text eol=lf +*.json text eol=lf +*.properties text eol=lf +LICENSE text eol=lf +nurfile text eol=lf +.gitignore text eol=lf +.gitattributes text eol=lf +.clang-format text eol=lf +.clang-tidy text eol=lf +Makefile text eol=lf +*.svg text eol=lf +*.ino text eol=lf +*.dot text eol=lf +*.cmake text eol=lf +*.css text eol=lf +Doxyfile text eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 05a48fc6..82160e5b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,9 @@ updates: directory: "/" schedule: interval: "weekly" + cooldown: + default-days: 5 + groups: + actions: + patterns: + - "*" diff --git a/.github/doxygen.py b/.github/doxygen.py index 7cdf569f..9a89d1b7 100644 --- a/.github/doxygen.py +++ b/.github/doxygen.py @@ -4,6 +4,7 @@ Running this locally will alter the Doxyfile. Such changes SHOULD NOT be pushed to the remote. """ + from pathlib import Path import json @@ -17,9 +18,12 @@ def overwrite_doxygen_value(): properties = json.loads(PROPERTIES.read_text(encoding="utf-8")) assert "version" in properties config = CONFIG.read_text(encoding="utf-8") - TMP.write_text("PROJECT_NUMBER = {}\n".format(properties["version"]), encoding="utf-8") + TMP.write_text( + "PROJECT_NUMBER = {}\n".format(properties["version"]), encoding="utf-8" + ) config += f"\n@INCLUDE = {str(TMP)}\n" CONFIG.write_text(config, encoding="utf-8") + if __name__ == "__main__": overwrite_doxygen_value() diff --git a/.github/workflows/build_arduino.yml b/.github/workflows/build_arduino.yml index c69a7097..de2dc86c 100644 --- a/.github/workflows/build_arduino.yml +++ b/.github/workflows/build_arduino.yml @@ -1,98 +1,107 @@ -name: Arduino CLI build - -on: - pull_request: - branches: [master, v1.x] - paths: - - ".github/workflows/build_arduino.yml" - - "examples/**" - - push: - branches: [master, v1.x] - paths: - - ".github/workflows/build_arduino.yml" - - "examples/**" - -jobs: - build: - uses: nRF24/.github/.github/workflows/build_arduino.yaml@main - with: - sketch-paths: | - - examples/helloworld_rx - - examples/helloworld_rx_advanced - - examples/helloworld_tx_advanced - - examples/helloworld_tx - - examples/Network_Priority_RX - - examples/Network_Priority_TX - # - examples/Network_Ping - # - examples/Network_Ping_Sleep - libraries: | - - source-url: https://github.com/nRF24/RF24.git - - source-path: ./ - - name: nrf_to_nrf - fqbn: ${{ matrix.fqbn }} - enable-deltas-report: ${{ matrix.enable-deltas-report }} - platforms: | - - name: arduino:avr - - name: arduino:megaavr - - name: arduino:samd - - name: arduino:mbed - # - name: arduino:sam - strategy: - fail-fast: false - matrix: - fqbn: - - "arduino:avr:yun" - - "arduino:avr:uno" - - "arduino:avr:diecimila" - - "arduino:avr:mega" - - "arduino:avr:megaADK" - - "arduino:avr:leonardo" - - "arduino:avr:micro" - - "arduino:avr:esplora" - - "arduino:avr:mini" - - "arduino:avr:ethernet" - - "arduino:avr:fio" - - "arduino:avr:bt" - # - "arduino:avr:LilyPad" # board not found - - "arduino:avr:LilyPadUSB" - - "arduino:avr:pro" - - "arduino:avr:atmegang" - - "arduino:avr:robotControl" - # - "arduino:avr:gemma" # does not support SPI - - "arduino:avr:circuitplay32u4cat" - - "arduino:avr:yunmini" - - "arduino:avr:chiwawa" - - "arduino:avr:one" - - "arduino:avr:unowifi" - - "arduino:mbed:nano33ble" - - "arduino:samd:mkr1000" - - "arduino:samd:mkrwifi1010" - - "arduino:samd:nano_33_iot" - - "arduino:samd:mkrfox1200" - - "arduino:samd:mkrwan1300" - - "arduino:samd:mkrwan1310" - - "arduino:samd:mkrgsm1400" - - "arduino:samd:mkrnb1500" - - "arduino:samd:mkrvidor4000" - - "arduino:samd:adafruit_circuitplayground_m0" - - "arduino:samd:mzero_pro_bl" - - "arduino:samd:mzero_bl" - - "arduino:samd:tian" - - "arduino:megaavr:uno2018" - # - "arduino:megaavr:nano4809" # board not found - # By default, don't generate size deltas data. - enable-deltas-report: - - false - # Generate size deltas data for this board - include: - - fqbn: arduino:avr:nano - enable-deltas-report: true - - fqbn: arduino:samd:mkrzero - enable-deltas-report: true - - # When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report - report: - needs: [build] - if: github.event_name == 'pull_request' - uses: nRF24/.github/.github/workflows/arduino_size_deltas.yaml@main +name: Arduino + +on: + pull_request: + branches: [master, v1.x] + paths: + - ".github/workflows/build_arduino.yml" + - "examples/**" + + push: + branches: [master, v1.x] + paths: + - ".github/workflows/build_arduino.yml" + - "examples/**" + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +jobs: + build: + uses: nRF24/.github/.github/workflows/build_arduino.yaml@main + with: + sketch-paths: | + - examples/helloworld_rx + - examples/helloworld_rx_advanced + - examples/helloworld_tx_advanced + - examples/helloworld_tx + - examples/Network_Priority_RX + - examples/Network_Priority_TX + # - examples/Network_Ping + # - examples/Network_Ping_Sleep + libraries: | + - source-url: https://github.com/nRF24/RF24.git + - source-path: ./ + - name: nrf_to_nrf + fqbn: ${{ matrix.fqbn }} + enable-deltas-report: ${{ matrix.enable-deltas-report }} + platforms: | + - name: arduino:avr + - name: arduino:megaavr + - name: arduino:samd + - name: arduino:mbed + # - name: arduino:sam + strategy: + fail-fast: false + matrix: + fqbn: + - "arduino:avr:yun" + - "arduino:avr:uno" + - "arduino:avr:diecimila" + - "arduino:avr:mega" + - "arduino:avr:megaADK" + - "arduino:avr:leonardo" + - "arduino:avr:micro" + - "arduino:avr:esplora" + - "arduino:avr:mini" + - "arduino:avr:ethernet" + - "arduino:avr:fio" + - "arduino:avr:bt" + # - "arduino:avr:LilyPad" # board not found + - "arduino:avr:LilyPadUSB" + - "arduino:avr:pro" + - "arduino:avr:atmegang" + - "arduino:avr:robotControl" + # - "arduino:avr:gemma" # does not support SPI + - "arduino:avr:circuitplay32u4cat" + - "arduino:avr:yunmini" + - "arduino:avr:chiwawa" + - "arduino:avr:one" + - "arduino:avr:unowifi" + - "arduino:mbed:nano33ble" + - "arduino:samd:mkr1000" + - "arduino:samd:mkrwifi1010" + - "arduino:samd:nano_33_iot" + - "arduino:samd:mkrfox1200" + - "arduino:samd:mkrwan1300" + - "arduino:samd:mkrwan1310" + - "arduino:samd:mkrgsm1400" + - "arduino:samd:mkrnb1500" + - "arduino:samd:mkrvidor4000" + - "arduino:samd:adafruit_circuitplayground_m0" + - "arduino:samd:mzero_pro_bl" + - "arduino:samd:mzero_bl" + - "arduino:samd:tian" + - "arduino:megaavr:uno2018" + # - "arduino:megaavr:nano4809" # board not found + # By default, don't generate size deltas data. + enable-deltas-report: + - false + # Generate size deltas data for this board + include: + - fqbn: arduino:avr:nano + enable-deltas-report: true + - fqbn: arduino:samd:mkrzero + enable-deltas-report: true + + # When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report + report: + needs: [build] + permissions: + # needed to post/update comment on PR threads + pull-requests: write + if: github.event_name == 'pull_request' + uses: nRF24/.github/.github/workflows/arduino_size_deltas.yaml@main diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index e7a8170a..a8a958ae 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -1,4 +1,4 @@ -name: Linux build +name: Linux on: pull_request: @@ -27,18 +27,22 @@ on: - "**pyRF24Network/setup.py" - "**pyRF24Network/*.cpp" - ".github/workflows/linux_build.yml" - release: - types: [created] + tags: ["*"] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: - using_cmake: + build: uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main with: rf24network-ref: ${{ github.sha }} compiler: ${{ matrix.toolchain.compiler }} usr-dir: ${{ matrix.toolchain.usr_dir }} examples-path: examples_RPi - deploy-release: ${{ github.event_name == 'release' && (matrix.toolchain.compiler == 'armhf' || matrix.toolchain.compiler == 'arm64') }} py-wrapper-path: RPi/pyRF24Network strategy: fail-fast: false @@ -54,3 +58,13 @@ jobs: # usr_dir: "i686-linux-gnu" - compiler: "default" # github runner is hosted on a "amd64" usr_dir: "local" + + deploy: + name: deploy release assets + needs: [build] + permissions: + # needed for uploading release assets + contents: write + if: startsWith(github.ref, 'refs/tags/') + uses: nRF24/.github/.github/workflows/deploy_cpack_artifacts.yaml@main + secrets: inherit diff --git a/.github/workflows/build_nrf_to_nrf.yml b/.github/workflows/build_nrf_to_nrf.yml index 31bd24b9..69af5561 100644 --- a/.github/workflows/build_nrf_to_nrf.yml +++ b/.github/workflows/build_nrf_to_nrf.yml @@ -1,25 +1,31 @@ -name: nRF52840 build - -on: - pull_request: - branches: [master] - push: - branches: [master] - -jobs: - build: - uses: nRF24/.github/.github/workflows/build_platformio.yaml@main - with: - example-path: ${{ matrix.example }} - board-id: ${{ matrix.board }} - lib-deps: -l https://github.com/TMRh20/nrf_to_nrf.git - strategy: - fail-fast: false - matrix: - example: - - "examples/nrf_to_nrf/helloworld_rx/helloworld_rx.ino" - - "examples/nrf_to_nrf/helloworld_tx/helloworld_tx.ino" - - "examples/nrf_to_nrf/helloworld_rxEncryption/helloworld_rxEncryption.ino" - - "examples/nrf_to_nrf/helloworld_txEncryption/helloworld_txEncryption.ino" - board: - - "adafruit_feather_nrf52840" +name: nRF52840 + +on: + pull_request: + branches: [master] + push: + branches: [master] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +jobs: + build: + uses: nRF24/.github/.github/workflows/build_platformio.yaml@main + with: + example-path: ${{ matrix.example }} + board-id: ${{ matrix.board }} + lib-deps: -l https://github.com/TMRh20/nrf_to_nrf.git + strategy: + fail-fast: false + matrix: + example: + - "examples/nrf_to_nrf/helloworld_rx/helloworld_rx.ino" + - "examples/nrf_to_nrf/helloworld_tx/helloworld_tx.ino" + - "examples/nrf_to_nrf/helloworld_rxEncryption/helloworld_rxEncryption.ino" + - "examples/nrf_to_nrf/helloworld_txEncryption/helloworld_txEncryption.ino" + board: + - "adafruit_feather_nrf52840" diff --git a/.github/workflows/build_platformIO.yml b/.github/workflows/build_platformIO.yml index ef598c3d..cc0598e0 100644 --- a/.github/workflows/build_platformIO.yml +++ b/.github/workflows/build_platformIO.yml @@ -1,4 +1,4 @@ -name: PlatformIO build +name: PlatformIO on: pull_request: @@ -15,15 +15,18 @@ on: - "library.json" - "examples/**" - "!examples/*.zip" - release: - types: [published, edited] + tags: ["*"] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: validate_lib_json: - uses: nRF24/.github/.github/workflows/validate_deploy_platformio.yaml@main - secrets: inherit - with: - deploy-release: ${{ github.event_name == 'release' }} + name: validate library.json + uses: nRF24/.github/.github/workflows/vaildate_platformio.yaml@main build: needs: [validate_lib_json] @@ -48,3 +51,13 @@ jobs: - "teensy40" - "teensy41" - "teensylc" + + deploy: + name: deploy release asset + if: startsWith(github.ref, 'refs/tags/') + needs: [validate_lib_json, build] + permissions: + # needed for uploading release assets + contents: write + uses: nRF24/.github/.github/workflows/deploy_platformio_artifact.yaml@main + secrets: inherit diff --git a/.github/workflows/build_rp2xxx.yml b/.github/workflows/build_rp2xxx.yml index dd49212a..599fe1d3 100644 --- a/.github/workflows/build_rp2xxx.yml +++ b/.github/workflows/build_rp2xxx.yml @@ -1,4 +1,4 @@ -name: Pico SDK build +name: Pico SDK on: push: @@ -20,8 +20,13 @@ on: - "cmake/**" - "examples_pico/*" -jobs: +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} +jobs: build: uses: nRF24/.github/.github/workflows/build_pico_sdk.yaml@main with: diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 88cb4701..d0963038 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -1,13 +1,24 @@ -name: check code formatting +name: Code format on: - push: - branches: [master, v1.x] - pull_request: - branches: [master, v1.x] + push: + branches: [master, v1.x] + pull_request: + branches: [master, v1.x] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: - check_formatting: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main - with: - extensions: ino,c,cpp,h \ No newline at end of file + check: + uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main + permissions: + # needed to detect changed files + contents: read + # needed to post review suggestions on PRs + pull-requests: write + with: + extensions: ino,c,cpp,h diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index ad16a9c3..ea5ce515 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -1,36 +1,50 @@ -name: build Docs - -on: - pull_request: - branches: [master, v1.x] - paths: - - "*.h" - - "docs/**" - - "!docs/README.md" - - "*.md" - - "images/**" - - ".github/workflows/doxygen.yml" - - "Doxyfile" - - "library.properties" # get lib version from here - push: - branches: [master, v1.x] - paths: - - "*.h" - - "docs/**" - - "!docs/README.md" - - "*.md" - - "images/**" - - ".github/workflows/doxygen.yml" - - "Doxyfile" - - "library.properties" # get lib version from here - release: - types: [published, edited] - workflow_dispatch: - -jobs: - build-docs: - uses: nRF24/.github/.github/workflows/build_docs.yaml@main - with: - deploy-gh-pages: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master') }} - doxygen-version: '1.11.0' - secrets: inherit +name: Docs + +on: + pull_request: + branches: [master, v1.x] + paths: + - "*.h" + - "docs/**" + - "!docs/README.md" + - "*.md" + - "images/**" + - ".github/workflows/doxygen.yml" + - "Doxyfile" + - "library.properties" # get lib version from here + push: + branches: [master, v1.x] + paths: + - "*.h" + - "docs/**" + - "!docs/README.md" + - "*.md" + - "images/**" + - ".github/workflows/doxygen.yml" + - "Doxyfile" + - "library.properties" # get lib version from here + tags: ["*"] + workflow_dispatch: + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +jobs: + build: + uses: nRF24/.github/.github/workflows/build_docs.yaml@main + with: + doxygen-version: '1.15.0' + + deploy: + needs: [build] + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') + permissions: + # to authenticate the gh-pages environment + id-token: write + # to upload to GitHub Pages + pages: write + uses: nRF24/.github/.github/workflows/deploy_docs.yaml@main + secrets: inherit diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e6f4edc3..6935517f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,20 +6,19 @@ version: 2 build: - os: "ubuntu-22.04" - apt_packages: - - libclang1-12 - - libclang-cpp12 + os: "ubuntu-24.04" + # apt_packages: + # - libclang1-12 + # - libclang-cpp12 tools: python: "3" commands: # Install doxygen from source distributions (conda forge does not keep up-to-date doxygen releases) - > - DOXYGEN_VERSION="1.12.0" && + DOXYGEN_VERSION="1.15.0" && + RELEASE_TITLE=$(echo ${DOXYGEN_VERSION} | tr '.' '_') && mkdir .doxygen && cd .doxygen && - echo $(pwd) && - echo "https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz" && - curl -L https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz && + curl -L "https://github.com/doxygen/doxygen/releases/download/Release_${RELEASE_TITLE}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" --output doxygen.tar.gz && gunzip doxygen.tar.gz && tar xf doxygen.tar && mv doxygen-$DOXYGEN_VERSION/bin/doxygen ./ diff --git a/docs/Doxyfile b/docs/Doxyfile index e2fc181a..8cb23267 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -148,6 +148,12 @@ GENERATE_TODOLIST = NO SHOW_USED_FILES = NO +# Don't display the ugly/complicated "tree view" side menu. +# And, restore the top (simpler) navigation bar. +# As of doxygen v1.13.0, these default values changed from NO to YES +GENERATE_TREEVIEW = NO +DISABLE_INDEX = NO + #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #---------------------------------------------------------------------------