Add jobs to install dependencies and build frontend #36
Workflow file for this run
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: Build PlatformIO project | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
environment: [d1_mini, thorrax] | |
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.11' | |
- name: Install PlatformIO Core | |
run: pip install --upgrade platformio | |
- name: Install dependencies for frontend | |
run: | | |
apt-get update && apt-get install --yes --no-install-recommends \ | |
npm \ | |
ruby-dev \ | |
xxd | |
npm install htmljs/ | |
npm install -g grunt-cli | |
gem install sass | |
- name: Build frontend | |
working-directory: htmljs | |
run: | | |
grunt i18n | |
output.sh | |
- name: Build ${{ matrix.environment }} | |
run: pio run -e ${{ matrix.environment }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.environment }}.bin | |
path: .pio/build/${{ matrix.environment }}/firmware.bin |