forked from nRF24/RF24
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (126 loc) · 4.16 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: PlatformIO build
on:
pull_request:
types: [opened, reopened]
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
- "examples/**"
- "!examples/old_backups/**"
- "!examples/rf24_ATTiny/**"
push:
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
- "examples/**"
- "!examples/old_backups/**"
- "!examples/rf24_ATTiny/**"
release:
types: [created]
jobs:
validate_lib_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: get latest release version number
id: latest_ver
run: echo "::set-output name=release::$(awk -F "=" '/version/ {print $2}' library.properties)"
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: package lib
run: pio package pack -o PlatformIO-RF24-${{ steps.latest_ver.outputs.release }}.tar.gz
- name: Save artifact
uses: actions/upload-artifact@v2
with:
name: "PIO_pkg_RF24"
path: PlatformIO*.tar.gz
- name: Upload Release assets
if: github.event_name == 'release'
uses: csexton/release-asset-action@master
with:
pattern: "PlatformIO*.tar.gz"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: upload package to PlatformIO Registry
if: github.event_name == 'release' && github.event_type != 'created'
# PIO lib packages cannot be re-published under the same tag
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
run: pio package publish --owner nrf24 --non-interactive
check_formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
# Ubuntu 20.04.4 LTS reunners ship with clang-tools v12
# - name: Install clang-tools
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: 12
- name: Install linter python package
run: python3 -m pip install cpp-linter
- name: run linter as a python package
id: linter
run: |
cpp-linter \
--version=12 \
--style=file \
--tidy-checks='-*' \
--files-changed-only='False' \
--extensions=ino \
--ignore='examples/old_backups'
- name: Linter checks failed?
if: steps.linter.outputs.checks-failed > 0
run: exit 1
build:
needs: [check_formatting, validate_lib_json]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
- "examples/GettingStarted/GettingStarted.ino"
- "examples/AcknowledgementPayloads/AcknowledgementPayloads.ino"
- "examples/ManualAcknowledgements/ManualAcknowledgements.ino"
- "examples/StreamingData/StreamingData.ino"
- "examples/MulticeiverDemo/MulticeiverDemo.ino"
- "examples/InterruptConfigure/InterruptConfigure.ino"
- "examples/encodeRadioDetails/encodeRadioDetails.ino"
board:
- "teensy31"
- "teensy35"
- "teensy36"
- "teensy40"
- "teensy41"
- "teensylc"
- "genericSTM32F411CE"
- "blackpill_f103c8"
- "nodemcuv2"
- "adafruit_qtpy_esp32s2"
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- 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 }}