From 25280bf9b16126344458b455418949f776f659a7 Mon Sep 17 00:00:00 2001 From: Yurii Date: Sun, 17 May 2026 19:32:27 +0300 Subject: [PATCH] chore: added build workflow --- .github/workflows/build.yaml | 100 +++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..536d86b --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,100 @@ +name: Build + +on: + workflow_dispatch: + push: + paths-ignore: ["assets/**", "tools/**", "**/*.md", "LICENSE"] + pull_request: + paths-ignore: ["assets/**", "tools/**", "**/*.md", "LICENSE"] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + prepare: + name: Prepare matrix + runs-on: ubuntu-latest + outputs: + envs: ${{ steps.envs.outputs.envs }} + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Python + uses: actions/setup-python@v6 + with: + python-version: "3.x" + + - name: Install PlatformIO Core + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + pip install --upgrade intelhex + + - id: envs + shell: bash + run: | + ENVS=$( + pio project config --json-output \ + | jq -c ' + .[] + | select(type == "array") + | .[0] + | select(startswith("env:")) + | sub("^env:"; "") + ' | jq -s -c '.' + ) + + echo "envs=$ENVS" >> "$GITHUB_OUTPUT" + echo "$ENVS" + + build: + name: Build ${{ matrix.env }} + runs-on: ubuntu-latest + needs: prepare + + strategy: + fail-fast: false + matrix: + env: ${{ fromJson(needs.prepare.outputs.envs) }} + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Python + uses: actions/setup-python@v6 + with: + python-version: "3.x" + + - name: Install Node.js + uses: actions/setup-node@v5 + with: + node-version: "22" + + - name: Install PlatformIO Core + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + pip install --upgrade intelhex + + - name: Full clean + run: | + pio run -e ${{ matrix.env }} -t fullclean + + - name: Build firmware & filesystem + env: + PIOENV: ${{ matrix.env }} + run: | + pio run -e ${{ matrix.env }} + + - name: Upload artifacts + uses: actions/upload-artifact@v7 + with: + name: ${{ matrix.env }} + if-no-files-found: error + path: | + build/*.bin + build/*.elf