Skip to content

Commit

Permalink
Doc tweaks and reusable CI (#887)
Browse files Browse the repository at this point in the history
* minor docs tweaks
  - show Table of Contents in Doxygen's Main/Related Pages
  - update sphinx customized CSS and conf.py
* update doxygen config (requires v1.9.5+)
* move docs-related files into docs folder
* make all CI reusable workflow callers
  • Loading branch information
2bndy5 committed Jan 9, 2023
1 parent d7c4041 commit e490a5a
Show file tree
Hide file tree
Showing 25 changed files with 216 additions and 1,422 deletions.
168 changes: 49 additions & 119 deletions .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,50 @@ on:
- ".github/workflows/build_arduino.yml"
- "examples/**"
- "!examples/old_backups/**"
env:
# convenient variable used multiple times
SKETCHES_REPORTS: sketches-reports

jobs:
check_formatting:
runs-on: ubuntu-latest
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: examples/old_backups
extensions: ino

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
# Ubuntu 20.04.4 LTS reunners ship with clang-tools v12
# - name: Install clang-tools
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: 12
- name: Install linter python package
run: python3 -m pip install cpp-linter
- name: run linter as a python package
id: linter
run: |
cpp-linter \
--version=12 \
--style=file \
--tidy-checks='-*' \
--files-changed-only='False' \
--extensions=ino \
--ignore='examples/old_backups'
- name: Linter checks failed?
if: steps.linter.outputs.checks-failed > 0
run: exit 1
build:
needs: check_formatting
runs-on: ubuntu-latest

uses: nRF24/.github/.github/workflows/build_arduino.yaml@main
with:
sketch-paths: |
- examples/GettingStarted
- examples/AcknowledgementPayloads
- examples/ManualAcknowledgements
- examples/StreamingData
- examples/MulticeiverDemo
- examples/InterruptConfigure
- examples/scanner
- examples/encodeRadioDetails
# The following examples still exist for posterity. They don't trigger this workflow
# - examples/old_backups/GettingStarted_HandlingFailures
# - examples/old_backups/pingpair_dyn
# - examples/old_backups/pingpair_irq
# - examples/old_backups/pingpair_multi_dyn
# - examples/old_backups/pingpair_sleepy
# - examples/old_backups/TransferTimeouts
# - examples/old_backups/recipes/led_remote
# - examples/old_backups/recipes/nordic_fob
# - examples/old_backups/recipes/pingpair_maple
fqbn: ${{ matrix.fqbn }}
enable-deltas-report: ${{ matrix.enable-deltas-report }}
# install earlphilhower's arduino-pico platform index
platforms: |
- name: rp2040:rp2040
source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
- name: arduino:avr
- name: arduino:megaavr
- name: arduino:sam
- name: arduino:samd
- name: arduino:mbed
strategy:
fail-fast: false

matrix:
fqbn:
- "arduino:avr:yun"
Expand Down Expand Up @@ -99,70 +105,30 @@ jobs:
# - "arduino:megaavr:nano4809" # board not found
- "arduino:sam:arduino_due_x_dbg"
# By default, don't generate size deltas data.
enable-deltas-report:
enable-deltas-report:
- false
# Generate size deltas data for this board
include:
- fqbn: arduino:avr:nano
enable-deltas-report: true
- fqbn: arduino:samd:mkrzero # InterruptConfigure.ino uses pin 2
enable-deltas-report: true


steps:
- name: Checkout
uses: actions/checkout@v2

- name: Compile examples
uses: arduino/compile-sketches@main
with:
sketch-paths: |
- examples/GettingStarted
- examples/AcknowledgementPayloads
- examples/ManualAcknowledgements
- examples/StreamingData
- examples/MulticeiverDemo
- examples/InterruptConfigure
- examples/scanner
- examples/encodeRadioDetails
# The following examples still exist for posterity. They don't trigger this workflow
# - examples/old_backups/GettingStarted_HandlingFailures
# - examples/old_backups/pingpair_dyn
# - examples/old_backups/pingpair_irq
# - examples/old_backups/pingpair_multi_dyn
# - examples/old_backups/pingpair_sleepy
# - examples/old_backups/TransferTimeouts
# - examples/old_backups/recipes/led_remote
# - examples/old_backups/recipes/nordic_fob
# - examples/old_backups/recipes/pingpair_maple
fqbn: ${{ matrix.fqbn }}
enable-deltas-report: ${{ matrix.enable-deltas-report }}
sketches-report-path: ${{ env.SKETCHES_REPORTS }}
# install earlphilhower's arduino-pico platform index
platforms: |
- name: rp2040:rp2040
source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
- name: arduino:avr
- name: arduino:megaavr
- name: arduino:sam
- name: arduino:samd
- name: arduino:mbed
# This step is needed to pass the size data to the report job
- name: Upload sketches report to workflow artifact
if: ${{ matrix.enable-deltas-report }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS }}
path: ${{ env.SKETCHES_REPORTS }}

attiny:
needs: check_formatting
runs-on: ubuntu-latest

uses: nRF24/.github/.github/workflows/build_arduino.yaml@main
with:
platforms: |
- source-url: "http://drazzy.com/package_drazzy.com_index.json"
name: "ATTinyCore:avr"
- name: "arduino:avr"
sketch-paths: |
- examples/rf24_ATTiny/rf24ping85
- examples/rf24_ATTiny/timingSearch3pin
fqbn: ${{ matrix.fqbn }}
enable-deltas-report: ${{ matrix.enable-deltas-report }}
strategy:
fail-fast: false

matrix:
fqbn:
- ATTinyCore:avr:attinyx4
Expand Down Expand Up @@ -195,44 +161,8 @@ jobs:
- fqbn: ATTinyCore:avr:attinyx5
enable-deltas-report: true

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Compile examples
uses: arduino/compile-sketches@main
with:
platforms: |
- source-url: "http://drazzy.com/package_drazzy.com_index.json"
name: "ATTinyCore:avr"
- name: "arduino:avr"
sketch-paths: |
- examples/rf24_ATTiny/rf24ping85
- examples/rf24_ATTiny/timingSearch3pin
fqbn: ${{ matrix.fqbn }}
enable-deltas-report: ${{ matrix.enable-deltas-report }}
sketches-report-path: ${{ env.SKETCHES_REPORTS }}

# This step is needed to pass the size data to the report job
- name: Upload sketches report to workflow artifact
if: ${{ matrix.enable-deltas-report }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS }}
path: ${{ env.SKETCHES_REPORTS }}

# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
report:
needs: [build, attiny]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Download sketches reports artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS }}
path: ${{ env.SKETCHES_REPORTS }}

- uses: arduino/report-size-deltas@v1
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS }}
uses: nRF24/.github/.github/workflows/arduino_size_deltas.yaml@main
Loading

0 comments on commit e490a5a

Please sign in to comment.