feat: Remove unnecessary write abortion checks in API data posting an… #19
This file contains hidden or 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: Compile and Flash ESP32 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'esp32-pit/**' | |
| env: | |
| FQBN: esp32:esp32:esp32s3 | |
| PORT_KEYWORD: usbmodem | |
| SKETCH_DIR: ./esp32-pit | |
| BUILD_DIR: ./esp32-pit/build/esp32.esp32.esp32s3 | |
| SERIAL_PORT: "" | |
| jobs: | |
| build-and-flash: | |
| runs-on: arduino-build | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install Arduino Libraries | |
| run: | | |
| while IFS= read -r lib || [ -n "$lib" ]; do | |
| if [[ -n "$lib" && "$lib" != \#* ]]; then | |
| echo "Installing: $lib" | |
| arduino-cli lib install "$lib" | |
| fi | |
| done < ${{ env.SKETCH_DIR }}/libraries.txt | |
| - name: Get the Serial Port | |
| run: | | |
| DETECTED_PORT=$(arduino-cli board list | grep ${{ env.PORT_KEYWORD }} | awk '{print $1}') | |
| echo "Found port: $DETECTED_PORT" | |
| if [ -z "$DETECTED_PORT" ]; then | |
| echo "No serial port found. Skipping upload." | |
| else | |
| echo "SERIAL_PORT=$DETECTED_PORT" >> $GITHUB_ENV | |
| fi | |
| - name: Compile ESP32 Sketch | |
| run: > | |
| arduino-cli compile | |
| -b ${{ env.FQBN }} | |
| -j 8 | |
| -t -v -e | |
| --warnings default | |
| --log | |
| ${{ env.SKETCH_DIR }} | |
| - name: Upload to ESP32 | |
| if: env.SERIAL_PORT != '' | |
| run: > | |
| arduino-cli upload | |
| -b ${{ env.FQBN }} | |
| -p ${{ env.SERIAL_PORT }} | |
| --input-dir ${{ env.BUILD_DIR }} | |
| -v --log |