-
-
Notifications
You must be signed in to change notification settings - Fork 3
122 lines (104 loc) · 3.3 KB
/
build_platformio.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: PlatformIO
on:
pull_request:
branches: [master]
paths:
- ".github/workflows/build_platformio.yml"
- "library.json"
- "examples/**/*.ino"
push:
branches: [master]
paths:
- ".github/workflows/build_platformio.yml"
- "library.json"
- "examples/**/*.ino"
release:
types: [created]
jobs:
validate_lib_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: get lib info
id: lib-info
run: |
echo "name=$(echo ${{ github.repository }} | sed -e 's;.\+/;;')" >> $GITHUB_OUTPUT
echo "release=$(awk -F "=" '/version/ {print $2}' library.properties)" >> $GITHUB_OUTPUT
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: package lib
run: pio package pack -o PlatformIO-${{ steps.lib-info.outputs.name }}-${{ steps.lib-info.outputs.release }}.tar.gz
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: PIO_pkg_${{ steps.lib-info.outputs.name }}
path: PlatformIO*.tar.gz
- name: Upload Release assets
if: github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "PlatformIO*.tar.gz"
- name: upload package to PlatformIO Registry
if: github.event_name == 'release'
# PIO lib packages cannot be re-published under the same tag
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
run: pio package publish --owner 2bndy5 --non-interactive
check_formatting:
uses: ./.github/workflows/cpp_lint.yaml
with:
extensions: ino
build:
needs: [check_formatting, validate_lib_json]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- "teensy31"
- "teensy35"
- "teensy36"
- "teensy40"
- "teensy41"
- "teensylc"
- "genericSTM32F411CE"
- "blackpill_f103c8"
- "nodemcuv2"
- "adafruit_qtpy_esp32s2"
example:
- "examples/absolute_mode/absolute_mode.ino"
- "examples/relative_mode/relative_mode.ino"
- "examples/anymeas_mode/anymeas_mode.ino"
steps:
- 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 }}-${{ matrix.board }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/checkout@v4
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: pio ci --lib="." --board=${{ matrix.board }}
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}