-
Notifications
You must be signed in to change notification settings - Fork 3
188 lines (181 loc) · 6.54 KB
/
jazzlights.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: "Jazzlights: Build and Test Code; Deploy Pages"
on:
push:
workflow_dispatch:
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check format
run: ./check_format.sh
extras:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
- name: Download and Install GLFW3 Dependency
run: |
GLFW_VERSION=$(curl -Ls https://api.github.com/repos/glfw/glfw/releases/latest | grep tag_name | sed 's/.*:[^"]"\([^"]*\)".*/\1/')
echo ${GLFW_VERSION}
curl -OLs https://github.com/glfw/glfw/releases/download/${GLFW_VERSION}/glfw-${GLFW_VERSION}.zip
rm -rf glfw-${GLFW_VERSION} >/dev/null 2>&1
unzip -q glfw-${GLFW_VERSION}.zip
cmake -S glfw-${GLFW_VERSION} -B glfw-${GLFW_VERSION}/build
sudo make -C glfw-${GLFW_VERSION}/build install
- name: Prepare CMake Files
run: cmake -S extras -B extras/build
- name: Build
run: cmake --build extras/build
- name: Run jazzlights-bench
run: extras/build/jazzlights-bench -k 2
pio-build:
strategy:
matrix:
pioenv:
- vest_dev
- vest_instrumentation
- clouds_s3_debug
- gauntlet
- vest_idf5
- vest_idf5_espidf
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: PlatformIO Build
run: pio run -e ${{ matrix.pioenv }}
pio-native-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: PlatformIO Test
run: pio test -e native
pio-merge:
strategy:
matrix:
pioenv:
- vest
- vest_s3
- shoe
- hat
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: PlatformIO Build Merged Vest Binary
run: MERGED_BIN_PATH="${{ runner.temp }}/${{ matrix.pioenv }}.bin" pio run -t mergebin -e ${{ matrix.pioenv }}
- name: Upload Merged Vest Binary as Artifact
uses: actions/upload-artifact@v4
with:
name: merged-binary-${{ matrix.pioenv }}
path: "${{ runner.temp }}/${{ matrix.pioenv }}.bin"
pages:
if: github.ref == 'refs/heads/main'
needs:
- check-format
- extras
- pio-build
- pio-native-test
- pio-merge
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pages-pip
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python Dependencies
run: pip install --upgrade beautifulsoup4 lxml
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Install Kramdown
run: gem install kramdown
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Create Temporary Site Directory
run: |
mkdir -p "${{ runner.temp }}/site-upload"
echo "upload_dir=${{ runner.temp }}/site-upload" >> "$GITHUB_ENV"
- name: Create HTML from Markdown
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
extras/site/create-html.py --template extras/site/template.html --markdown README.md --url $url --output "${upload_dir}/index.html"
extras/site/create-html.py --template extras/site/template.html --markdown extras/docs/VEST.md --url $url --title "JazzLights Vest" --output "${upload_dir}/vest.html"
- name: Copy Images
run: cp -R extras/docs/images "${upload_dir}/"
- name: Copy Static Files to Flash Folder
run: |
mkdir -p "${upload_dir}/flash/esp-web-tools"
cp -R extras/site/flash/esp-web-tools/*.js "${upload_dir}/flash/esp-web-tools/"
cp extras/site/flash/index.html "${upload_dir}/flash/"
cp extras/site/style.css "${upload_dir}/"
extras/site/flash/manifest.py --output "${upload_dir}/flash/manifest-vest.json" --name "JazzLights Vest" --version $(git rev-parse --short "$GITHUB_SHA") --firmware vest.bin --firmware-s3 vest_s3.bin
extras/site/flash/manifest.py --output "${upload_dir}/flash/manifest-shoe.json" --name "JazzLights Shoe" --version $(git rev-parse --short "$GITHUB_SHA") --firmware shoe.bin
extras/site/flash/manifest.py --output "${upload_dir}/flash/manifest-hat.json" --name "JazzLights Hat" --version $(git rev-parse --short "$GITHUB_SHA") --firmware hat.bin
- name: Download Binaries to Site Directory
uses: actions/download-artifact@v4
with:
pattern: merged-binary-*
path: "${{ runner.temp }}/site-upload/flash/"
merge-multiple: true
- run: ls -l "${upload_dir}/flash/"
- run: find "${upload_dir}/flash/"
- name: Upload Pages
uses: actions/upload-pages-artifact@v3
with:
path: "${{ runner.temp }}/site-upload"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4