-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2307622
Showing
2 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# PlatformIO Run | ||
|
||
GitHub Action for PlatformIO Run. | ||
|
||
## Usage | ||
|
||
`.github/workflows/platformio-build.yml` | ||
|
||
```yml | ||
name: PlatformIO | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: PlatformIO Run | ||
- uses: karniv00l/[email protected] | ||
with: | ||
environments: "teensy35,teensy36,teensy41" | ||
targets: "teensy35,teensy36,teensy41" | ||
project-dir: "./some_dir" | ||
project-conf: "./some_dir/custom.ini" | ||
jobs: 6 | ||
silent: false | ||
verbose: true | ||
disable-auto-clean: false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: PlatformIO Run | ||
description: Run 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@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 | ||
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 |