-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (76 loc) · 2.64 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
# Created this action based on information found in:
# - <https://docs.platformio.org/en/latest/integration/ci/github-actions.html>
# - <https://docs.github.com/en/free-pro-team@latest/actions/quickstart>
name: build-platformio
on:
push:
paths-ignore:
- '.github/workflows/build-arduino.yml'
- 'docs/**'
repository_dispatch:
types: [rebuild]
pull_request:
workflow_dispatch:
inputs:
iotsa_ref:
description: 'iotsa branch, ref or sha'
required: true
detault: develop
env:
iotsa_ref: develop
this_product: unknown
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
board:
- lolin32
- esp32thing
build_flags: [""]
steps:
- name: Set env
run: |
echo this_product=$(echo "${{ github.repository }}" | awk -F / '{print $2}' | sed -e "s/:refs//") >> $GITHUB_ENV
if [ "${{ github.event_name }}" == "repository_dispatch" ]; then
echo "iotsa_ref=${{ github.event.client_payload.iotsa_ref }}" >> $GITHUB_ENV
echo "repository_dispatch: iotsa_ref=${{ github.event.client_payload.iotsa_ref }}"
fi
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "iotsa_ref=${{ github.event.inputs.iotsa_ref }}" >> $GITHUB_ENV
echo "workflow_dispatch: iotsa_ref=${{ github.event.inputs.iotsa_ref }}"
fi
- name: Checkout code
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
pio platform install --with-package framework-arduinoespressif8266 espressif8266
pio platform install --with-package framework-arduinoespressif32 espressif32
- name: Install library dependencies
run: |
pio lib -g install -f "https://github.com/cwi-dis/iotsa.git#${{ env.iotsa_ref }}"
- name: Run PlatformIO
run: |
pio run --environment ${{ matrix.board }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.this_product }}-${{ matrix.board }}-${{ env.iotsa_ref }}.bin
path: .pio/build/${{ matrix.board }}/firmware.bin