2021-05-26 12:12:26 +02:00
|
|
|
name: Build ESP
|
|
|
|
|
|
|
|
on:
|
2023-05-25 11:53:32 +02:00
|
|
|
workflow_dispatch:
|
2021-05-26 12:12:26 +02:00
|
|
|
push:
|
2022-12-08 03:44:26 +01:00
|
|
|
paths:
|
2022-12-08 05:47:01 +01:00
|
|
|
- 'src/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'lib/**'
|
2022-12-08 05:48:53 +01:00
|
|
|
- 'hw/**'
|
2023-02-01 10:36:39 +01:00
|
|
|
- '.github/workflows/build_esp.yml'
|
2022-12-08 03:44:26 +01:00
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
paths:
|
2022-12-08 05:47:01 +01:00
|
|
|
- 'src/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'lib/**'
|
|
|
|
- 'hw/**'
|
2023-02-01 10:36:39 +01:00
|
|
|
- '.github/workflows/build_esp.yml'
|
2021-05-26 12:12:26 +02:00
|
|
|
|
2022-12-04 15:08:47 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-05-26 12:12:26 +02:00
|
|
|
jobs:
|
|
|
|
build-esp:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
board:
|
|
|
|
# ESP32-S2
|
2023-12-11 08:52:21 +01:00
|
|
|
- 'espressif_kaluga_1'
|
2021-05-26 12:12:26 +02:00
|
|
|
# ESP32-S3
|
2023-11-29 11:09:52 +01:00
|
|
|
- 'espressif_s3_devkitc'
|
2021-05-26 12:12:26 +02:00
|
|
|
steps:
|
|
|
|
- name: Setup Python
|
2022-11-06 09:17:00 +01:00
|
|
|
uses: actions/setup-python@v4
|
2022-11-06 16:06:22 +01:00
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
2021-05-26 12:12:26 +02:00
|
|
|
|
|
|
|
- name: Pull ESP-IDF docker
|
|
|
|
run: docker pull espressif/idf:latest
|
|
|
|
|
|
|
|
- name: Checkout TinyUSB
|
2023-12-18 14:07:17 +01:00
|
|
|
uses: actions/checkout@v4
|
2021-05-26 12:12:26 +02:00
|
|
|
|
|
|
|
- name: Build
|
2023-04-03 12:44:05 +02:00
|
|
|
run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32.py ${{ matrix.board }}
|
2023-12-11 05:45:50 +01:00
|
|
|
|
|
|
|
- name: Upload Artifacts for Hardware Testing
|
|
|
|
if: matrix.board == 'espressif_s3_devkitc' && github.repository_owner == 'hathach'
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.board }}
|
|
|
|
path: |
|
2023-12-11 05:56:04 +01:00
|
|
|
cmake-build/cmake-build-${{ matrix.board }}/*/*/bootloader/bootloader.bin
|
|
|
|
cmake-build/cmake-build-${{ matrix.board }}/*/*/*.bin
|
|
|
|
cmake-build/cmake-build-${{ matrix.board }}/*/*/partition_table/partition-table.bin
|
|
|
|
cmake-build/cmake-build-${{ matrix.board }}/*/*/config.env
|
|
|
|
cmake-build/cmake-build-${{ matrix.board }}/*/*/flash_args
|
2023-12-11 08:29:11 +01:00
|
|
|
|
|
|
|
# ---------------------------------------
|
|
|
|
# Hardware in the loop (HIL)
|
|
|
|
# Current self-hosted instance is running on an RPI4. For attached hardware checkout hil_pi4.json
|
|
|
|
# ---------------------------------------
|
|
|
|
hil-test:
|
|
|
|
# run only with hathach's commit due to limited resource on RPI4
|
|
|
|
if: github.repository_owner == 'hathach'
|
|
|
|
needs: build-esp
|
|
|
|
runs-on: [self-hosted, esp32s3, hardware-in-the-loop]
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
board:
|
|
|
|
- 'espressif_s3_devkitc'
|
|
|
|
steps:
|
|
|
|
- name: Clean workspace
|
|
|
|
run: |
|
|
|
|
echo "Cleaning up previous run"
|
|
|
|
rm -rf "${{ github.workspace }}"
|
|
|
|
mkdir -p "${{ github.workspace }}"
|
|
|
|
|
2023-12-14 10:52:45 +01:00
|
|
|
# USB bus on rpi4 is not stable, reset it before testing
|
|
|
|
- name: Reset USB bus
|
|
|
|
run: |
|
|
|
|
for port in $(lspci | grep USB | cut -d' ' -f1); do
|
|
|
|
echo -n "0000:${port}"| sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind;
|
|
|
|
sleep 0.1;
|
|
|
|
echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind;
|
|
|
|
done
|
|
|
|
|
2023-12-11 08:29:11 +01:00
|
|
|
- name: Checkout test/hil
|
2023-12-18 14:07:17 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-12-11 08:29:11 +01:00
|
|
|
with:
|
|
|
|
sparse-checkout: test/hil
|
|
|
|
|
|
|
|
- name: Download Artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.board }}
|
2023-12-11 08:43:54 +01:00
|
|
|
path: cmake-build/cmake-build-${{ matrix.board }}
|
2023-12-11 08:29:11 +01:00
|
|
|
|
2023-12-13 13:05:44 +01:00
|
|
|
- name: Test on actual hardware
|
|
|
|
run: |
|
|
|
|
python3 test/hil/hil_test.py --board ${{ matrix.board }} hil_pi4.json
|