Fix docs deployment workflow #169
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: CI | |
on: | |
- push | |
- workflow_dispatch | |
permissions: | |
contents: write | |
jobs: | |
prettier: | |
name: Prettier check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.10.0' | |
cache: 'pnpm' | |
- name: Install frontend dependencies, check Prettier formatting | |
run: | | |
pnpm i | |
pnpm lint:prettier | |
cpp_format: | |
name: C++ Formatting Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run clang-format style check for C/C++/Protobuf programs. | |
uses: jidicula/[email protected] | |
with: | |
clang-format-version: '17' | |
frontend_eslint: | |
name: ESLint Frontend | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.10.0' | |
cache: 'pnpm' | |
- name: Install frontend dependencies, run ESLint | |
run: | | |
pnpm i | |
pnpm lint:frontend:eslint | |
frontend_typescript: | |
name: Typescript Frontend | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.10.0' | |
cache: 'pnpm' | |
- name: Install frontend dependencies, check typing | |
run: | | |
pnpm i | |
pnpm lint:frontend:ts | |
actionlint: | |
name: Actionlint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: actionlint | |
uses: raven-actions/actionlint@v1 | |
build_esp: | |
name: Build ESP binaries | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.10.0' | |
cache: 'pnpm' | |
- name: Install frontend dependencies and build frontend | |
run: | | |
pnpm i | |
pnpm build | |
- name: Cache esp-idf build | |
uses: actions/cache@v3 | |
with: | |
path: 'build' | |
key: ${{ runner.os }}-build-v5 | |
- name: Cache managed components | |
uses: actions/cache@v3 | |
with: | |
path: 'managed_components' | |
key: ${{ runner.os }}-managed_components-${{ hashFiles('dependencies.lock') }}-v2 | |
- name: Address ESP-IDF component hash bug | |
run: | | |
rm -rf managed_components/bblanchon__arduinojson/.component_hash | |
- name: esp-idf build | |
run: | | |
docker run -t -e IDF_TARGET="esp32" -e GITHUB_ACTIONS=true -v "${GITHUB_WORKSPACE}:/app/${{ github.repository }}" \ | |
-w "/app/${{ github.repository }}" espressif/idf:release-v5.1 \ | |
/bin/bash -c 'git config --global --add safe.directory "*" && idf.py build' | |
- name: Archive build output artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: | | |
build/bootloader/bootloader.bin | |
build/partition_table/partition-table.bin | |
build/suntransit.bin | |
build/www.bin | |
build_simulator: | |
name: Build simulator binary | |
timeout-minutes: 10 | |
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.12' | |
- name: Install SDL2 | |
run: | | |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse" | |
sudo apt-get update -y -qq | |
sudo apt-get install libsdl2-dev | |
- name: Install PlatformIO Core | |
run: pip install --upgrade platformio | |
- name: Build PlatformIO Project | |
run: | | |
cd simulator | |
pio run --verbose --environment emulator |