Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc tweaks and reusable CI #887

Merged
merged 5 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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