6
6
push :
7
7
branches : ["main"]
8
8
paths-ignore :
9
- - ' **.md'
9
+ - " **.md"
10
10
11
11
# Allows you to run this workflow manually from the Actions tab
12
12
workflow_dispatch :
@@ -28,110 +28,91 @@ jobs:
28
28
build :
29
29
runs-on : ubuntu-latest
30
30
steps :
31
- - name : Checkout
32
- uses : actions/checkout@v3
33
-
34
- # Install the Arduino CLI
35
- - name : Install Arduino CLI
36
- uses : arduino/setup-arduino-cli@v1
37
-
38
- # Install TFT_eSPI
39
- - name : Install TFT_eSPI library to prepare for modifications
40
- run : |
41
- arduino-cli lib install TFT_eSPI
42
-
43
- # Copy binaries to GitHubPages folder for publishing
44
- - name : Copy User_Setup.h for TFT_eSPI
31
+ - uses : actions/checkout@v4
32
+ - uses : actions/cache@v3
33
+ - name : Cache pip
34
+ uses : actions/cache@v3
35
+ with :
36
+ path : ~/.cache/pip
37
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
38
+ restore-keys : |
39
+ ${{ runner.os }}-pip-
40
+ - name : Cache PlatformIO
41
+ uses : actions/cache@v3
42
+ with :
43
+ path : ~/.platformio
44
+ key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
45
+ - name : Set up Python
46
+ uses : actions/setup-python@v4
47
+ with :
48
+ python-version : " 3.10"
49
+ - name : Install PlatformIO
45
50
run : |
46
- \cp -fR DisplayConfig/User_Setup.h ~/Arduino/libraries/TFT_eSPI/
47
-
48
- # Build CYD Arduino Code
49
- - uses : arduino/compile-sketches@v1
50
- name : Compile CYD code
51
- with :
52
- fqbn : " esp32:esp32:esp32"
53
- platforms : |
54
- - name: esp32:esp32
55
- source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
56
- # No need to specify ESP-libraries as these are installed with the platform (on the line above).
57
- # Downloading SpeedyStepper from source to get correct casing on import of Arduino.h (spelled arduino.h in the version from Arduino Library Manager)
58
- libraries : |
59
- - name: ImageFetcher
60
- source-url: https://github.com/witnessmenow/file-fetcher-arduino.git
61
- - name: WiFiManager
62
- - name: ESP_DoubleResetDetector
63
- - name: ArduinoJson
64
- - name: ezTime
65
- - name: UniversalTelegramBot
66
- - name: PNGdec
67
- sketch-paths : |
68
- - F1-Notifications
69
- enable-warnings-report : true
70
- verbose : false
71
- cli-compile-flags : |
72
- - --export-binaries
73
-
74
- # Copy binaries to GitHubPages folder for publishing
75
- - name : Copy compiled binaries to CYD
51
+ python -m pip install --upgrade pip
52
+ pip install --upgrade platformio
53
+
54
+ # Build CYD
55
+ - name : Build CYD
56
+ run : platformio run -e cyd
57
+ - name : Upload artifact
58
+ uses : actions/upload-artifact@v3
59
+ with :
60
+ name : CYD Firmware
61
+ path : .pio/build/cyd/firmware.bin
62
+ if-no-files-found : error
63
+ - name : Copy compiled binaries for webflash
76
64
run : |
77
- # mkdir GitHubPages/ESPWebTools/esp32Firmware
78
65
mkdir GitHubPages/ESPWebTools/cyd
79
66
80
67
# Copy the manifest file for the CYD
81
68
cp GitHubPages/ESPWebTools/manifest.json GitHubPages/ESPWebTools/cyd
82
-
83
- # Copy compiled binaries that were exported by the `-e` flag in the arduino/compile-sketches task
84
- # Maintain folder structure, for cases where we are compiling for multiple board versions
85
- # If we were sure that we would never need to compile for anything other then esp32:esp32:esp32, we could have used this command instead: cp -r OpenMacroRail_Arduino/build/esp32.esp32.esp32/*.bin GitHubPages/ESPWebTools/esp32Firmware
86
- cd F1-Notifications/build
87
- find . -print | grep -i .bin$ | xargs -i cp --parent {} ../../GitHubPages/ESPWebTools/cyd
88
- cd ../..
89
-
90
- # Copy boot_app0.bin to the esp32Firmware folder. This file will be common for all esp32 boards (i think)
91
- # Using a version agnostic search to find the file. grep -m 1 makes sure only one file is copied in case multiple versions are installed.
92
- find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -type f | grep -i -m 1 boot_app0.bin$ | xargs -i cp {} GitHubPages/ESPWebTools/cyd
93
-
94
- # Build Matrix Arduino Code
95
- - uses : arduino/compile-sketches@v1
96
- name : Compile Matrix code
97
- with :
98
- fqbn : " esp32:esp32:esp32"
99
- platforms : |
100
- - name: esp32:esp32
101
- source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
102
- # No need to specify ESP-libraries as these are installed with the platform (on the line above).
103
- # Downloading SpeedyStepper from source to get correct casing on import of Arduino.h (spelled arduino.h in the version from Arduino Library Manager)
104
- libraries : |
105
- - name: ImageFetcher
106
- source-url: https://github.com/witnessmenow/file-fetcher-arduino.git
107
- - name: ESP32 HUB75 LED MATRIX PANEL DMA Display
108
- source-url: https://github.com/witnessmenow/ESP32-HUB75-MatrixPanel-I2S-DMA.git
109
- - name: Adafruit GFX Library
110
- sketch-paths : |
111
- - F1-Notifications
112
- enable-warnings-report : true
113
- verbose : false
114
- cli-compile-flags : |
115
- - --build-property
116
- - compiler.cpp.extra_flags=-DMATRIX_DISPLAY
117
- - --export-binaries
118
-
119
- # Copy binaries to GitHubPages folder for publishing
120
- - name : Copy compiled binaries to Matrix
69
+
70
+ cp .pio/build/cyd/bootloader.bin GitHubPages/ESPWebTools/cyd
71
+ cp .pio/build/cyd/partitions.bin GitHubPages/ESPWebTools/cyd
72
+ cp /home/runner/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin GitHubPages/ESPWebTools/cyd
73
+ cp .pio/build/cyd/firmware.bin GitHubPages/ESPWebTools/cyd
74
+
75
+ # Build CYD2USB
76
+ - name : Build CYD2USB
77
+ run : platformio run -e cyd2usb
78
+ - name : Upload artifact
79
+ uses : actions/upload-artifact@v3
80
+ with :
81
+ name : CYD Firmware
82
+ path : .pio/build/cyd2usb/firmware.bin
83
+ if-no-files-found : error
84
+ - name : Copy compiled binaries for webflash
85
+ run : |
86
+ mkdir GitHubPages/ESPWebTools/cyd2usb
87
+
88
+ # Copy the manifest file for the cyd2usb
89
+ cp GitHubPages/ESPWebTools/manifest.json GitHubPages/ESPWebTools/cyd2usb
90
+
91
+ cp .pio/build/cyd2usb/bootloader.bin GitHubPages/ESPWebTools/cyd2usb
92
+ cp .pio/build/cyd2usb/partitions.bin GitHubPages/ESPWebTools/cyd2usb
93
+ cp /home/runner/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin GitHubPages/ESPWebTools/cyd
94
+ cp .pio/build/cyd2usb/firmware.bin GitHubPages/ESPWebTools/cyd2usb
95
+
96
+ # Build Matrix
97
+ - name : Build Matrix
98
+ run : platformio run -e trinity
99
+ - name : Upload artifact
100
+ uses : actions/upload-artifact@v3
101
+ with :
102
+ name : CYD Firmware
103
+ path : .pio/build/trinity/firmware.bin
104
+ if-no-files-found : error
105
+ - name : Copy compiled binaries for webflash
121
106
run : |
122
- # Make matrix directory
123
107
mkdir GitHubPages/ESPWebTools/matrix
124
108
125
- # Copy the manifest file for the matrix
109
+ # Copy the manifest file for the Matrix
126
110
cp GitHubPages/ESPWebTools/manifest.json GitHubPages/ESPWebTools/matrix
127
-
128
- cd F1-Notifications/build
129
- find . -print | grep -i .bin$ | xargs -i cp --parent {} ../../GitHubPages/ESPWebTools/matrix
130
- cd ../..
131
-
132
- # Copy boot_app0.bin to the esp32Firmware folder. This file will be common for all esp32 boards (i think)
133
- # Using a version agnostic search to find the file. grep -m 1 makes sure only one file is copied in case multiple versions are installed.
134
- find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -type f | grep -i -m 1 boot_app0.bin$ | xargs -i cp {} GitHubPages/ESPWebTools/matrix
111
+
112
+ cp .pio/build/trinity/bootloader.bin GitHubPages/ESPWebTools/matrix
113
+ cp .pio/build/trinity/partitions.bin GitHubPages/ESPWebTools/matrix
114
+ cp /home/runner/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin GitHubPages/ESPWebTools/matrix
115
+ cp .pio/build/trinity/firmware.bin GitHubPages/ESPWebTools/matrix
135
116
136
117
# Build GitHub Page
137
118
- name : Setup Github Page
@@ -156,4 +137,4 @@ jobs:
156
137
steps :
157
138
- name : Deploy to GitHub Pages
158
139
id : deployment
159
- uses : actions/deploy-pages@v2
140
+ uses : actions/deploy-pages@v2
0 commit comments