Skip to content

Commit 3f5a64c

Browse files
committed
CI: Build examples in PRs only after adding label
1 parent 0d8000f commit 3f5a64c

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

.github/workflows/build-examples.yml renamed to .github/workflows/build-examples-master.yml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
8-
branches:
9-
- master
107
jobs:
118
build-examples:
129
strategy:
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build Examples
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
jobs:
7+
build-examples:
8+
strategy:
9+
matrix:
10+
example:
11+
- Async-Server
12+
- Authentication
13+
- HTML-Forms
14+
- HTTPS-and-HTTP
15+
- Middleware
16+
- Parameters
17+
- Parameter-Validation
18+
- Put-Post-Echo
19+
- REST-API
20+
- Self-Signed-Certificate
21+
- Static-Page
22+
- Websocket-Chat
23+
board:
24+
- wrover
25+
- wroom
26+
runs-on: ubuntu-latest
27+
if: "contains( github.event.pull_request.labels.*.name, 'CI: Build Examples' )"
28+
steps:
29+
- name: Checkout codebase
30+
uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e
31+
- name: Set up Python
32+
uses: actions/setup-python@9ac730844c47e52575257e93faf193c4530bc095
33+
with:
34+
python-version: '3.8'
35+
- name: Install PlatformIO
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install platformio
39+
- name: Build example
40+
run: ./extras/ci/scripts/build-example.sh ${{ matrix.board }} ${{ matrix.example }}
41+
remove-label:
42+
runs-on: ubuntu-latest
43+
if: "contains( github.event.pull_request.labels.*.name, 'CI: Build Examples' )"
44+
steps:
45+
- name: Remove Label from PR
46+
uses: octokit/request-action@57ec46afcc4c58c813af3afe67e57ced1ea9f165
47+
with:
48+
route: DELETE /repos/:repository/issues/:issue_number/labels/:name
49+
repository: ${{ github.repository }}
50+
issue_number: ${{ github.event.number }}
51+
name: 'CI: Build Examples'
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+

0 commit comments

Comments
 (0)