Skip to content

Instantly share code, notes, and snippets.

@vixtory09678
Created June 4, 2022 22:06
Show Gist options
  • Save vixtory09678/e5d5d7098988ba792c7df4195846b3d3 to your computer and use it in GitHub Desktop.
Save vixtory09678/e5d5d7098988ba792c7df4195846b3d3 to your computer and use it in GitHub Desktop.
name: PlatformIO CI
on: [push]
jobs:
dependencies:
name: setup dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip
id: cache-pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python
if: steps.cache-pip.outputs.cache-hit != 'true'
uses: actions/setup-python@v2
- name: Install pip
if: steps.cache-pip.outputs.cache-hit != 'true'
run: python -m pip install --upgrade pip
build:
needs: dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip
id: cache-pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: |
pip install -U platformio
platformio update
- name: build project
run: platformio run
lint:
needs: dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip
id: cache-pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: |
pip install -U platformio
platformio update
- name: check format
run: platformio check --fail-on-defect high
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment