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:
|
2022-11-01 11:37:18 +01:00
|
|
|
- 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:
|
|
|
|
|
2023-01-20 22:36:45 +01:00
|
|
|
|
2023-01-21 13:42:12 +01:00
|
|
|
jobs:
|
2023-01-20 22:15:55 +01:00
|
|
|
deploy-on-testboard:
|
2023-01-21 13:40:29 +01:00
|
|
|
name: Deploy code on testboard
|
2023-01-20 22:15:55 +01:00
|
|
|
runs-on: windows-latest
|
2023-01-17 14:02:13 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
2023-01-20 22:15:55 +01:00
|
|
|
path: ~\AppData\Local\pip\Cache
|
2023-01-17 14:02:13 +01:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Cache PlatformIO
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
2023-01-20 22:15:55 +01:00
|
|
|
path: ~\AppData\Local\platformio\Cache
|
2023-01-17 14:02:13 +01:00
|
|
|
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 13:52:35 +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
|
2023-01-21 14:26:59 +01:00
|
|
|
sed -i "s/APPEUI[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};/${{secrets.APPEUI}}/g" "src/loraconf.h"
|
|
|
|
sed -i "s/APPKEY[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};/${{secrets.APPKEY}}/g" "src/loraconf.h"
|
2023-01-20 22:32:37 +01:00
|
|
|
- name: Build and deploy for testboard
|
2023-01-17 14:02:13 +01:00
|
|
|
env:
|
2023-01-21 14:13:52 +01:00
|
|
|
PLATFORMIO_AUTH_TOKEN: ${{secrets.PLATFORMIO_AUTH_TOKEN}}
|
2023-01-20 22:32:37 +01:00
|
|
|
run: pio remote -a prenzlpi run -t upload -r
|