Skip to content

Commit

Permalink
adds reusable platformio action
Browse files Browse the repository at this point in the history
  • Loading branch information
bchampp committed May 30, 2021
1 parent 3ba4da5 commit 8eb3b47
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/common/platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Build Platform IO Project'
description: 'Workflow to build a given platformIO project.'
inputs:
platform:
description: 'The board platform the action is running on.'
required: true
directory:
description: 'The directory the platformIO project is in.'

runs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- 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: Build Project
run: pio run -e ${{ inputs.platform }}
working-directory: ${{ inputs.directory }}

0 comments on commit 8eb3b47

Please sign in to comment.