-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
80 lines (76 loc) · 2.78 KB
/
action.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
name: PlatformIO Run
description: Run PlatformIO project targets over environments declared in platformio.ini
author: Piotr Rogowski <[email protected]>
branding:
icon: cpu
color: orange
inputs:
environments:
description: Process specified environments (comma separated).
required: false
targets:
description: Process specified targets (comma separated).
required: false
project-dir:
description: Specify the path to project directory. By default, project-dir is equal to current working directory (CWD).
required: false
project-conf:
description: Process project with a custom platformio.ini
required: false
jobs:
description: Control a number of parallel build jobs. Default is a number of CPUs in a system.
required: false
silent:
description: Suppress progress reporting.
required: false
verbose:
description: Shows detailed information when processing environments.
required: false
disable-auto-clean:
description: Disable auto-clean of build_dir when platformio.ini or src_dir (project structure) have been modified.
required: false
runs:
using: composite
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 }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install PlatformIO
shell: bash
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
shell: bash
run: |
environments=${{ inputs.environments }}
targets=${{ inputs.targets }}
project_dir=${{ inputs.project-dir }}
project_conf=${{ inputs.project-conf }}
jobs=${{ inputs.jobs }}
silent=${{ inputs.silent }}
verbose=${{ inputs.verbose }}
disable_auto_clean=${{ inputs.disable-auto-clean }}
args=()
if [ -n "$environments" ]; then args+=("--environment ${environments//,/ -e }"); fi
if [ -n "$targets" ]; then args+=("--target ${targets//,/ -t }"); fi
if [ -n "$project_dir" ]; then args+=("--project-dir $project_dir"); fi
if [ -n "$project_conf" ]; then args+=("--project-conf $project_conf"); fi
if [ -n "$jobs" ]; then args+=("--jobs $jobs"); fi
if [ -n "$silent" ]; then args+=("--silent"); fi
if [ -n "$verbose" ]; then args+=("--verbose"); fi
if [ -n "$disable_auto_clean" ]; then args+=("--disable-auto-clean"); fi
echo ${args[*]} | xargs pio run