Skip to content

Commit

Permalink
- chore(actions): added github actions for build on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Lukas committed Sep 16, 2023
1 parent aecaeb0 commit 6268f7d
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/act/pullrequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"action": "opened",
"number": 1,
"pull_request": {
"base": {
"ref": "main"
},
"head": {
"ref": "feature-branch"
}
}
}
5 changes: 5 additions & 0 deletions .github/act/push.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"push": {
"ref": "refs/tags/v.0.2.0"
}
}
5 changes: 5 additions & 0 deletions .github/act/tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"push": {
"ref": "refs/master"
}
}
54 changes: 54 additions & 0 deletions .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Bluetti ESP32 Bridge with Arduino IDE
on:
push:
branches:
- main
pull_request:
types:
- opened
workflow_run:
workflows: ["Build with Arduino on PR Request"]
types:
- completed
branches:
- main # Change this to the branch you want to trigger the build on
-
jobs:
build-firmware:
runs-on: ubuntu-latest

steps:

- name: 🏗 Install build dependencies
run: sudo apt-get -qq update && sudo apt-get -y install build-essential curl python3-serial

- name: ⬇ Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0


- name: Install Arduino CLI
run: curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh

- name: Install platform
run: |
arduino-cli core update-index
arduino-cli core install esp32:esp32
- name: Install Platform
run: |
arduino-cli lib install WiFiManager
arduino-cli lib install PubSubClient
export ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true && arduino-cli lib install --git-url https://github.com/me-no-dev/AsyncTCP.git
export ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true && arduino-cli lib install --git-url https://github.com/me-no-dev/ESPAsyncWebServer.git
export ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true && arduino-cli lib install --git-url https://github.com/h2zero/NimBLE-Arduino.git
arduino-cli lib install AsyncElegantOTA
arduino-cli lib install "Adafruit SSD1306"
arduino-cli lib install "Adafruit GFX Library"
arduino-cli lib install "Adafruit BusIO"
- name: 🔨 Build Firmware
run: |
cd Bluetti_ESP32
arduino-cli compile --fqbn esp32:esp32:esp32 Bluetti_ESP32.ino
43 changes: 43 additions & 0 deletions .github/workflows/build_pio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build Bluetti ESP32 Bridge with PlatformIO

on:
push:
branches:
- main
pull_request:
types:
- opened
workflow_run:
workflows: ["Build with PlatformIO on PR Request"]
types:
- completed
branches:
- main # Change this to the branch you want to trigger the build on

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Set the desired Python version

- name: Install PlatformIO
run: |
pip install -U platformio
platformio platform install espressif32
- name: Build ESP32 Program
run: |
platformio run
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: firmware # Set the name of the artifact directory
# path: .pio/build/<environment_name> # Replace <environment_name> with your PlatformIO environment name

0 comments on commit 6268f7d

Please sign in to comment.