-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (109 loc) · 4.8 KB
/
build-datalogger-iot.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Build DataLogger Firmware Action
on:
push:
branches:
- main
workflow_dispatch:
branches:
env:
DATALOGGER_IOT_APP_KEY: ${{ secrets.DATALOGGER_IOT_APP_KEY }}
DATALOGGER_IOT_ID_KEY: ${{ secrets.DATALOGGER_IOT_ID_KEY }}
jobs:
build:
name: Build DataLogger IoT
runs-on: ubuntu-latest
steps:
- name: Checkout Repo and submodules
uses: actions/checkout@v3
with:
ref: main
# setup the ssh key used to pull in the Flux SDK source. This was the
# only way found to make this work when using private models (ssh private key here, public on Flux deploy keys
- name: Et Tu Submodule
uses: webfactory/ssh-agent@master
with:
ssh-private-key: |
${{ secrets.FLUX_PULL_KEY_2 }}
# checkout flux-sdk
- name: Checkout the flux-sdk
run: |
git clone --branch main [email protected]:sparkfun/flux-sdk.git
echo "FLUX_SDK_PATH=`pwd`/flux-sdk" >> $GITHUB_ENV
# Run cmake - this will build a custom SparkFun_Flux library we can use with
# the Arduino CLI
- name: Run CMake
run: |
echo $FLUX_SDK_PATH
mkdir -p build
cd build
cmake ..
cd ..
# Setup Arduino command line - install esp32 and all the libs flux needs
- name: Arduino - Install and setup the Arduino CLI
uses: arduino/setup-arduino-cli@v1
- name: Arduino - Start config file
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
- name: Arduino - Update index
run: arduino-cli core update-index
# Install ESP32 - v2.0.9 (May, 2023)
- name: Arduino - Install ESP32 platform
run: arduino-cli core install esp32:esp32
# install the libraries Flux uses
- name: Install Flux dependant libraries.
run: ./flux-sdk/install-libs.sh
- name: Install datalogger libraries
run: arduino-cli lib install FastLED ESPAsyncWebSrv
# Compile time - build the Firmware for the data logger.
# Note:
# - The use of a full path to flux - this is needed or the build fails (relative paths get merged).
# - We are providing a custom partition structure for the ESP32
- name: Compile DataLogger firmware binary
run:
arduino-cli compile --fqbn esp32:esp32:esp32 ./sfeDataLoggerIoT/sfeDataLoggerIoT.ino
--build-property upload.maximum_size=3145728 --build-property build.flash_size=16MB --build-property build.partitions=partitions
--build-property build.flash_mode=dio --build-property build.flash_freq=80m
--build-property "compiler.cpp.extra_flags=\"-DDATALOGGER_IOT_APP_KEY=$DATALOGGER_IOT_APP_KEY\" \"-DDATALOGGER_IOT_ID_KEY=$DATALOGGER_IOT_ID_KEY\" \"-DBUILD_NUMBER=$GITHUB_RUN_NUMBER\""
--export-binaries --clean --library `pwd`/SparkFun_Flux
# - name: Rename Library
# run: |
# cd sfeDataLoggerIoT/build/esp32.esp32.esp32/
# mv sfeDataLoggerIoT.ino.bin SparkFun_DataLoggerIoT.bin
# Upload the build files - bootloader, paritions, firmware
- uses: actions/upload-artifact@v3
with:
name: sfeDataLoggerIoT-build
path: sfeDataLoggerIoT/build/esp32.esp32.esp32/sfeDataLoggerIoT.ino*.bin
# Now build the python fuse tool package
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
# Setup python packages
- name: Setup Python
run: |
pip3 install setuptools
- name: Build Python Package
run: |
cd fuse_id
python setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: Flash ID CLI Tool
path: fuse_id/dist
# now build our burn took production config file
- name: Build product burn config file
run: ./fuse_id/dl_build_conf.py
- uses: actions/upload-artifact@v3
with:
name: SparkFunProductionConfig
path: dl_fuseid.conf
# - name: Compile Sketch
# run: arduino-cli compile --fqbn esp32:esp32:esp32 ./Firmware/RTK_Surveyor/RTK_Surveyor.ino
# --build-property build.partitions=partitions
# --build-property upload.maximum_size=3145728
# --build-property "compiler.cpp.extra_flags=\"-DPOINTPERFECT_TOKEN=$POINTPERFECT_TOKEN\" \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\" \"-DENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }}\""
# --export-binaries
# - name: Rename binary
# run: |
# cd Firmware/RTK_Surveyor/build/esp32.esp32.esp32/
# mv RTK_Surveyor.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin