Skip to content

Github Actions CI

Github Actions CI #17

Workflow file for this run

name: Github Actions CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
# */2: even, */4: every 4
# +--------------> minute (0 - 59)
# | +------------> hour (0 - 23)
# | | +----------> day of the month (1 - 31)
# | | | +--------> month (1 - 12)
# | | | | +------> day of the week (0 - 6)
# | | | | |
- cron: "0 0 1 */4 *"
# Run this workflow manually from the Actions tab
workflow_dispatch:
env:
# To use repository name: ${{ github.event.repository.name }}
PDF_NAME: ${{ github.event.repository.name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build examples
run: |
BOARDS_AVR="--board uno --board micro --board pro16MHzatmega328 --board pro8MHzatmega328 --board megaatmega2560 --board leonardo"
BOARDS_ARM="--board due"
BOARDS_ESP8266="--board nodemcuv2"
BOARDS_ESP32="--board lolin_d32"
echo "Installing library dependencies"
pio pkg install --global --library https://github.com/Erriez/ErriezTM1637
pio pkg install --global --library https://github.com/Erriez/ErriezRobotDyn4DigitDisplay
pio pkg install --global --library https://github.com/knolleary/pubsubclient
echo "Building AVR, ARM and ESP8266 examples..."
# Use option -O "lib_ldf_mode=chain+" to parse macro's
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} examples/ErriezMHZ19B7SegmentDisplay/ErriezMHZ19B7SegmentDisplay.ino
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} examples/ErriezMHZ19BGettingStarted/ErriezMHZ19BGettingStarted.ino
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} examples/ErriezMHZ19BSerialPlottter/ErriezMHZ19BSerialPlottter.ino
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_ESP8266} examples/ErriezMHZ19BESP8266MQTT/ErriezMHZ19BESP8266MQTT.ino
# Install ESP32 libraries and build
# Note: Library EspSoftwareSerial can only be used for ESP8266 and ESP32 and results in build errors on other platforms!
# Issue: https://github.com/platformio/platformio-core/issues/4410
pio pkg install --global --library "EspSoftwareSerial@6.16.1"
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_ESP32} examples/ErriezMHZ19B7SegmentDisplay/ErriezMHZ19B7SegmentDisplay.ino
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_ESP32} examples/ErriezMHZ19BGettingStarted/ErriezMHZ19BGettingStarted.ino
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_ESP32} examples/ErriezMHZ19BSerialPlottter/ErriezMHZ19BSerialPlottter.ino
pio pkg uninstall --global --library "EspSoftwareSerial@6.16.1"
doxygen:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "true"
- name: Install Doxygen
run: sudo apt-get install doxygen graphviz -y
shell: bash
- name: Generate Doxygen HTML
run: doxygen Doxyfile
shell: bash
- name: Create .nojekyll (ensures pages with underscores work on gh pages)
run: touch docs/html/.nojekyll
shell: bash
- name: Generate Doxygen PDF
if: ${{ github.ref == 'refs/heads/master' }}
run: |
sudo apt-get install texlive-latex-recommended texlive-pictures texlive-latex-extra -y
make -C docs/latex
cp docs/latex/refman.pdf docs/html/$PDF_NAME.pdf
shell: bash
- name: Deploy to GitHub branch gh-pages
if: ${{ github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/html