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

69 lines
1.9 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'
2023-01-18 10:19:29 +01:00
workflow_dispatch:
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-18 10:05:00 +01:00
cp platformio_test.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
2023-01-18 10:28:47 +01:00
- name: Build and deploy for ${{ matrix.board }}
2023-01-17 14:02:13 +01:00
env:
2023-01-18 10:24:45 +01:00
CI_HALFILE: ${{ matrix.board }}
2023-01-17 14:02:13 +01:00
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
2023-01-18 10:30:51 +01:00
run: pio remote -a prenzlpi run -t upload