mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-05-18 07:18:15 +05:00
chore: added build workflow
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user