1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-24 00:26:13 +01:00
CommandStation-EX/.github/workflows/main.yml
chatelao 53f598192c Add - Firmware packeage & firmware on Wokwi
The GitHub action is changed:
- Newer version of Checkout Action
- Caching of PlatformIO files
- All build firmwares (.bin / .hex) are bundles into a files
- All firmwares runnable on Wokwi are run as simulation

n.b.: To run on Wokwi a secret credetial has to be stored on the account.
2024-01-06 19:54:52 +01:00

83 lines
2.6 KiB
YAML

name: PlatformIO CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Use sample "config.example.h" for compilations
run: mv $GITHUB_WORKSPACE/config.example.h $GITHUB_WORKSPACE/config.h
- name: Build PlatformIO Project
run: pio run
- name: Copy all firmwares for for packaging
run: |
mkdir downloads
cd .pio/build
find . -name '*.bin' | cpio -pdm ../../downloads
find . -name '*.hex' | cpio -pdm ../../downloads
find . -name '*.uf2' | cpio -pdm ../../downloads
cd ../..
- name: Package and upload all firmwares for download
uses: actions/upload-artifact@v3
with:
name: all-firmwares-for-download
path: downloads
- name: Test on Arduino MEGA with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/mega # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: '<* LCD3:Free RAM='
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional
- name: Test on Arduino UNO with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/uno # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: '<* LCD3:Free RAM='
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional
- name: Test on Arduino NANO with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/nano # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: '<* LCD3:Free RAM='
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional
- name: Test on ESP32 with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/esp32 # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: 'ESP32 / STANDARD_MOTOR_SHIELD'
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional