Skip to content

Rename bonsai-growlab-local back to bonsai-growlab #127

Rename bonsai-growlab-local back to bonsai-growlab

Rename bonsai-growlab-local back to bonsai-growlab #127

Workflow file for this run

name: ESP32
on:
pull_request:
push:
branches:
- master
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
#
# refs:
# - https://stackoverflow.com/questions/70435286/resource-not-accessible-by-integration-on-github-post-repos-owner-repo-ac
# - https://github.com/actions/cache/blob/6849a6489940f00c2f30c0fb92c6274307ccb58a/tips-and-workarounds.md?plain=1#L57
# - https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
actions: write
env:
SOURCE_PATH: project
IDF_PATH: esp-idf
IDF_VERSION: v5.3.1
CONFIGURATION_PATH_CCACHE: .env/ccache
CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL: .env/bonsai_growlab_local_configuration
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_PATH }}
submodules: recursive
- name: node.js setup env
uses: actions/setup-node@v4
with:
node-version: '20'
- name: esp32 setup env
uses: ./project/control-components/.github/actions/esp32/env
with:
IDF_PATH: ${{ env.IDF_PATH }}
IDF_VERSION: ${{ env.IDF_VERSION }}
- name: system setup env
uses: ./project/control-components/.github/actions/system/env
- name: system setup ccache
uses: ./project/control-components/.github/actions/system/ccache
with:
GITHUB_TOKEN: ${{ github.token }}
PROJECT_PATH: ${{ env.SOURCE_PATH }}
CONTROL_COMPONENTS_PATH: ${{ env.SOURCE_PATH }}/control-components
CONFIGURATION_PATH_CCACHE: ${{ env.CONFIGURATION_PATH_CCACHE }}
- name: core format firmware build version
id: version_formatter
uses: ./project/control-components/.github/actions/core/version
- name: bonsai-growlab check formatting
uses: ./project/control-components/.github/actions/core/fmt
with:
PROJECT_PATH: ${{ env.SOURCE_PATH }}/projects/bonsai-growlab
CONTROL_COMPONENTS_PATH: ${{ env.SOURCE_PATH }}/control-components
- name: bonsai-growlab prepare configuration
shell: bash
run: |
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_BME280_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_BME280_SPI_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_SHT41_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_SOIL_ANALOG_RELAY_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_SOIL_ANALOG_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_LDR_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_DS18B20_SOIL_TEMPERATURE_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_SENSOR_DS18B20_OUTSIDE_TEMPERATURE_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_BONSAI_FIRMWARE_CONSOLE_ENABLE=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_OCS_CORE_FW_VERSION=\"${{ steps.version_formatter.outputs.build_version }}\"" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_OCS_CORE_FW_NAME=\"bonsai-growlab\"" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_OCS_CORE_FW_DESCRIPTION=\"Bonsai GrowLab Firmware\"" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
echo "CONFIG_FREERTOS_USE_TRACE_FACILITY=y" >> ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
- name: bonsai-growlab web GUI build
shell: bash
run: |
cd ${{ env.SOURCE_PATH }}/projects/bonsai-growlab/web-gui
npm install
npm run build
npm run fmt
if [ -n "$(git status --porcelain .)" ]; then
echo "Please run 'npm run fmt' and commit the updated files."
exit 1
fi
- name: bonsai-growlab build
uses: ./project/control-components/.github/actions/esp32/project
with:
IDF_PATH: ${{ env.IDF_PATH }}
PROJECT_PATH: ${{ env.SOURCE_PATH }}/projects/bonsai-growlab
CONFIGURATION_PATH_CCACHE: ${{ env.CONFIGURATION_PATH_CCACHE }}
CONFIGURATION_PATH_PROJECT: ${{ env.CONFIGURATION_PATH_BONSAI_GROWLAB_LOCAL }}
- name: bonsai-growlab upload
uses: ./project/control-components/.github/actions/esp32/upload
with:
PROJECT_PATH: ${{ env.SOURCE_PATH }}/projects/bonsai-growlab
PROJECT_ID: bonsai-growlab