42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Remote run m5atom-matrix
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
remote-run:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Cache pip
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
- name: Cache PlatformIO
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.platformio
|
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install PlatformIO
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install --upgrade platformio
|
|
pio platform update
|
|
pio run -t clean
|
|
- name: Setup Versioning
|
|
run: echo "PLATFORMIO_BUILD_FLAGS=-DVERSION='\"${GITHUB_REF#refs/*/}\"'" >> $GITHUB_ENV
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
- name: PlatformIO Login
|
|
run: pio account login --username="${{secrets.PIO_USERNAME}}" --password="${{secrets.PIO_PASSWORD}}"
|
|
- name: Remote Run
|
|
run: pio remote run -t upload -t monitor --upload-port=/dev/ttyUSB0 -e m5atom-matrix
|
|
- name: Remote Monitor
|
|
run: pio remote device monitor --port=/dev/ttyUSB0
|