-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (92 loc) · 4.27 KB
/
actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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 "[email protected]"
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 "[email protected]"
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