ci(release): preparing for the next v0.0.3 release #11
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: TFLMWrapper ESP32 Integration Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache pip packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache PlatformIO packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.platformio | |
key: ${{ runner.os }}-platformio-${{ hashFiles('**/platformio.ini') }} | |
restore-keys: | | |
${{ runner.os }}-platformio- | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install platformio | |
- name: Install ESP32 toolchain | |
run: | | |
platformio platform install espressif32 | |
- name: Build project and tests | |
run: | | |
# Attempt to build tests and capture output | |
platformio test --without-uploading --without-testing -e esp32-s3-devkitc-1-mcu-test 2>&1 | tee build_output.log | |
# Store the exit code | |
BUILD_EXIT_CODE=${PIPESTATUS[0]} | |
# Always create artifacts directory | |
mkdir -p artifacts | |
cp build_output.log artifacts/ | |
# Copy the entire .pio directory for debugging if needed | |
cp -r .pio artifacts/ | |
# Exit with the original build exit code | |
exit $BUILD_EXIT_CODE | |
- name: Upload build artifacts | |
# Upload the artifacts if the build fails | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: | | |
artifacts/ | |
platformio.ini |