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

ci: Switch to GitHub Actions for CI #28

Merged
merged 39 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f8744fa
ci: add github actions workflow
prototypicalpro Nov 21, 2020
43028d0
ci: fix typos in CI workflow
prototypicalpro Nov 21, 2020
7815fd0
ci: more typo fixes
prototypicalpro Nov 21, 2020
5108f69
ci: fix sslclient directory
prototypicalpro Nov 21, 2020
a732b3f
ci: more verbose output
prototypicalpro Nov 21, 2020
11b6749
ci: move some properties to env
prototypicalpro Nov 21, 2020
a32267f
ci: fix broken substitution
prototypicalpro Nov 21, 2020
34c3874
ci: update data directory
prototypicalpro Nov 21, 2020
d3cbeee
ci: replace with absolute path
prototypicalpro Nov 21, 2020
1ed2760
ci: remove different data directory for now
prototypicalpro Nov 21, 2020
44781c5
ci: add docs workflow and precompiled artifact
prototypicalpro Nov 28, 2020
e1a27a4
fix typo
prototypicalpro Nov 28, 2020
b54d738
fix typo
prototypicalpro Nov 28, 2020
844203e
remove extra flag
prototypicalpro Nov 28, 2020
a5241bb
add pyserial setup for esp32
prototypicalpro Nov 28, 2020
aa8a8a6
fix improper quoting
prototypicalpro Nov 28, 2020
6800bc0
limit artifact upload to one example
prototypicalpro Nov 28, 2020
032a7b0
add generate-release workflows
prototypicalpro Nov 28, 2020
0c9b403
ignore push to gh-pages
prototypicalpro Nov 28, 2020
5b1c9a4
add tags
prototypicalpro Nov 28, 2020
996ae4a
move additional URLs to global
prototypicalpro Nov 28, 2020
4f16fa1
add platformio testing
prototypicalpro Nov 28, 2020
3597ac3
remove YAML anchor :(
prototypicalpro Nov 28, 2020
851f9fa
fix library name
prototypicalpro Nov 28, 2020
749b6b4
remove -v switch
prototypicalpro Nov 28, 2020
5d4408b
fix example path for pio
prototypicalpro Nov 28, 2020
e8515c8
fix examples not seeing trust anchors
prototypicalpro Nov 28, 2020
9b7f905
add LwIP for stm32
prototypicalpro Nov 28, 2020
532ad99
fix library name
prototypicalpro Nov 28, 2020
e147992
force include SPI library for TIVAC
prototypicalpro Nov 29, 2020
0ff4ed8
fix typo
prototypicalpro Nov 29, 2020
fb13ff6
add Teensy 4.0 and AWS IoT example
prototypicalpro Nov 29, 2020
adf5d16
add example to list
prototypicalpro Nov 29, 2020
2c31731
switch to EthernetLarge
prototypicalpro Nov 29, 2020
252c070
refactor printf to print
prototypicalpro Nov 29, 2020
968c80a
fix changelog generation
prototypicalpro Nov 29, 2020
8d05a16
add more teensy varients
prototypicalpro Nov 29, 2020
44db64c
fix invalid board specifier
prototypicalpro Nov 29, 2020
a254b16
remove .travis.yml
prototypicalpro Nov 29, 2020
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
281 changes: 281 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
name: CI
on:
push:
tags:
- v*
branches-ignore:
- gh-pages
pull_request:

env:
ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS: "https://adafruit.github.io/arduino-board-index/package_adafruit_index.json https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json"

jobs:
build-examples-arduino:
name: Arduino ${{ matrix.example }} for ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- EthernetHTTPS
- EthernetMultiHTTPS
- EthernetMQTT
- EthernetAWSIoT
board:
# Arduino Zero
- arduino-platform: arduino:samd
fqbn: arduino:samd:mzero_bl
# Adafruit Feather M0
- arduino-platform: arduino:samd adafruit:samd
fqbn: adafruit:samd:adafruit_feather_m0
# Arduino Due
- arduino-platform: arduino:sam
fqbn: arduino:sam:arduino_due_x
# ESP32
- arduino-platform: esp32:esp32
fqbn: esp32:esp32:d32
include:
# STM32 Nucleo 144
- board:
arduino-platform: STM32:stm32
fqbn: STM32:stm32:Nucleo_144:pnum=NUCLEO_F767ZI
pio-platform: nucleo_f767zi
example: stm32/EthernetHTTPSstm32
steps:
# Setup pyserial for esptool.py
- name: Setup Python
if: matrix.board.arduino-platform == 'esp32:esp32'
uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Install Pyserial
if: matrix.board.arduino-platform == 'esp32:esp32'
run: |
python -m pip install --upgrade pip
pip install pyserial

# Setup Arduino-CLI
- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v1.1.1

# Install Dependencies
- name: Install Core(s)
run: arduino-cli core install ${{ matrix.board.arduino-platform }} -v
- name: Install EthernetLarge
run: git clone https://github.com/OPEnSLab-OSU/EthernetLarge.git ~/Arduino/libraries/EthernetLarge
- name: Install Other Libraries
run: arduino-cli lib install "STM32duino STM32Ethernet" PubSubClient -v

# Checkout
- name: Checkout
uses: actions/checkout@v2
with:
path: SSLClient

# Compile
- name: Compile Sketch
run: arduino-cli compile -v --libraries . --warnings all --fqbn ${{ matrix.board.fqbn }} SSLClient/examples/${{ matrix.example }}

build-examples-platformio:
name: PIO ${{ matrix.example }} for ${{ matrix.board.pio-platform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Copy of the above matrix (no anchors :( )
example:
- EthernetHTTPS
- EthernetMultiHTTPS
- EthernetMQTT
- EthernetAWSIoT
board:
# Arduino Zero
- pio-platform: zeroUSB
# Adafruit Feather M0
- pio-platform: adafruit_feather_m0
# Arduino Due
- pio-platform: dueUSB
# ESP32
- pio-platform: lolin32
# Teensy 4.0
- pio-platform: teensy40
# Teensy 3.6
- pio-platform: teensy36
# Teensy 3.5
- pio-platform: teensy35
# Teensy 3.1/3.2
- pio-platform: teensy31
# Teensy 3.0
- pio-platform: teensy30
include:
# STM32 Nucleo 144
- board:
pio-platform: nucleo_f767zi
example: stm32/EthernetHTTPSstm32
# TIVA-C
- board:
pio-platform: lptm4c1294ncpdt
extra-flags: -O "lib_deps=SPI"
example: tivac/EthernetHTTPStivac
steps:
# Setup python for platformio
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax

# Setup PlatformIO
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install pyserial platformio

# Install Dependencies
- name: Install Libraries
run: |
pio lib -g install "stm32duino/STM32duino LwIP"
pio lib -g install stm32duino/STM32Ethernet
pio lib -g install PubSubClient
pio lib -g install https://github.com/OPEnSLab-OSU/EthernetLarge.git

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

# Compile
- name: Compile Sketch
run: pio ci -l . -b ${{ matrix.board.pio-platform }} ${{ matrix.board.extra-flags }} ${{ github.workspace }}/examples/${{ matrix.example }}

compile-archives:
name: Compile Archives
runs-on: ubuntu-latest
needs: [build-examples-arduino, build-examples-platformio]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
strategy:
fail-fast: true
matrix:
include:
# Adafruit Feather M0
- board:
arduino-platform: arduino:samd adafruit:samd
fqbn: adafruit:samd:adafruit_feather_m0
arch: cortex-m0plus
example: EthernetHTTPS
# Arduino Due
- board:
arduino-platform: arduino:sam
fqbn: arduino:sam:arduino_due_x
arch: cortex-m3
example: EthernetHTTPS
# ESP32
- board:
arduino-platform: esp32:esp32
fqbn: esp32:esp32:d32
arch: esp32
example: EthernetHTTPS
# STM32
- board:
arduino-platform: STM32:stm32
fqbn: STM32:stm32:Nucleo_144:pnum=NUCLEO_F767ZI
arch: cortex-m7
example: stm32/EthernetHTTPSstm32
steps:
# Setup pyserial for esptool.py
- name: Setup Python
if: matrix.board.arduino-platform == 'esp32:esp32'
uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Install Pyserial
if: matrix.board.arduino-platform == 'esp32:esp32'
run: |
python -m pip install --upgrade pip
pip install pyserial

# Setup Arduino-CLI
- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v1.1.1

# Install Dependencies
- name: Install Core(s)
run: arduino-cli core install ${{ matrix.board.arduino-platform }} -v
- name: Install EthernetLarge
run: git clone https://github.com/OPEnSLab-OSU/EthernetLarge.git ~/Arduino/libraries/EthernetLarge
- name: Install Other Libraries
run: arduino-cli lib install "STM32duino STM32Ethernet" PubSubClient -v

# Checkout
- name: Checkout
uses: actions/checkout@v2
with:
path: SSLClient

# Compile with dot-a-linkage
- name: Compile with Archive
run: |
echo "dot_a_linkage=true" >> SSLClient/library.properties
arduino-cli compile -v --build-path ${{ github.workspace }}/build --libraries . --warnings all --fqbn ${{ matrix.board.fqbn }} SSLClient/examples/${{ matrix.example }}

# Upload as an artifact
- name: Emit Compiled SSLClient
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.board.arch }}
path: build/libraries/SSLClient/SSLClient.a

generate-release:
name: Generate Release
runs-on: ubuntu-latest
needs: compile-archives
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

# Build the release changelog
- name: Build Changelog
id: build_changelog
uses: heineiuo/create-changelogs@master

# Create a release
- name: Publish Release
id: publish_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.build_changelog.outputs.changelogs }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Create SSLClient-precompiled
- name: Convert Library to Precompiled Format
run: |
echo "precompiled=true" >> library.properties
rm -rf .git
find src/ -iname "*.c" -delete
find src/ -iname "*.cpp" -delete

# Download all the artifacts
- name: Add Precompiled Artifacts
uses: actions/download-artifact@v2
with:
path: src

# Zip the result
- name: Generate SSLClient-precompiled
run: zip -r SSLClient-precompiled.zip .

# Upload SSLClient-precompiled.zip to the release created
- name: Upload SSLClient-precompiled
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.publish_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./SSLClient-precompiled.zip
asset_name: SSLClient-precompiled.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Documentation
on:
push:
branches:
- master

jobs:
documentation:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Build Documentation
uses: mattnotmitt/doxygen-action@v1

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
Loading