Skip to content

Commit

Permalink
Refactor PlatformIO setup in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSchinazi committed Jul 18, 2024
1 parent 66ba48f commit 8281d61
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
27 changes: 5 additions & 22 deletions .github/workflows/jazzlights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,7 @@ jobs:
platformio:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- uses: ./.github/workflows/setup-platformio.yml
- name: PlatformIO Build
run: pio run
- name: PlatformIO Test
Expand All @@ -72,19 +61,13 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/workflows/setup-platformio.yml
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: "3.12"
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Install Python Dependencies
run: pip install --upgrade platformio beautifulsoup4 lxml
run: pip install --upgrade beautifulsoup4 lxml
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/setup-platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Checks out code, sets up PlatformIO and its dependencies

on:
workflow_call:

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PlatformIO Core
run: pip install --upgrade platformio

0 comments on commit 8281d61

Please sign in to comment.