ESP32-PaxCounter/.github/workflows/build.yml

72 lines
2.0 KiB
YAML
Raw Normal View History

2023-01-17 14:56:40 +01:00
name: PlatformIO CI/CD
2022-10-27 12:34:43 +02:00
on:
pull_request:
2022-11-22 15:53:30 +01:00
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
- 'README.md'
2022-10-27 12:34:43 +02:00
push:
2022-10-27 13:34:26 +02:00
branches:
- master
- build-workflow
2022-11-22 15:53:30 +01:00
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
- 'README.md'
2022-11-01 11:20:17 +01:00
workflow_dispatch:
2022-10-27 12:34:43 +02:00
2022-11-22 15:53:30 +01:00
2022-10-27 12:34:43 +02:00
jobs:
2023-01-17 14:56:40 +01:00
2023-01-17 14:02:13 +01:00
deploy:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
path: ~/.cache/pip
platformio-path: ~/.platformio
board: [ttgov21new.h]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ${{ matrix.platformio-path }}
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9.13"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Copy of necessary files
run: |
2023-01-17 15:09:21 +01:00
cp platformio_orig.ini platformio.ini
2023-01-17 14:02:13 +01:00
cp src/loraconf_sample.h src/loraconf.h
cp src/ota_sample.conf src/ota.conf
cp src/paxcounter_orig.conf src/paxcounter.conf
- name: Clean
2023-01-17 15:11:33 +01:00
#run: pio run -t clean -e cd
2023-01-17 15:30:53 +01:00
run: pio remote -a prenzlpi run -e usb -t clean -r -v
2023-01-17 14:02:13 +01:00
- name: Build and deploy for ${{ matrix.board }}
env:
CI_HALFILE: ${{ matrix.board }}
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
2023-01-17 15:30:53 +01:00
run: pio remote -a prenzlpi run -e usb -t upload -r -v