Revert adding sin_len since it breaks Linux #115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |