-
Notifications
You must be signed in to change notification settings - Fork 18
92 lines (82 loc) · 2.55 KB
/
platformio.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
81
82
83
84
85
86
87
88
89
90
91
92
# yaml-language-server: $schema=https://github.com/SchemaStore/schemastore/raw/master/src/schemas/json/github-workflow.json
# PlatformIO Build Workflow
# https://docs.platformio.org/en/latest/integration/ci/github-actions.html
# Only tests for the standard enviroment defined in the platformio.ini!
# TODO Get Version Name in here! (hint: see scripts/ci)
name: PlatformIO
# run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}
on:
push:
branches: [ "main" ] # Only run on main branch
paths: # Only run on these directories
- data
- inc
- include
- src
pull_request:
branches: [ "main" ] # Only run on main branch
paths: # Only run on these directories
- data
- inc
- include
- src
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
# TODO Set enviroment variable for later use
# env:
# BUILD: GITHUB
jobs:
build:
name: PlatformIO Build
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
path:
~\AppData\Local\pip\Cache
~\.platformio\.cache
- os: ubuntu-latest
path:
~/.cache/pip
~/.platformio/.cache
- os: macos-latest
path:
~/Library/Caches/pip
~/.platformio/.cache
permissions:
actions: read # private repos
contents: write # private repos
packages: read # fetch internal or private CodeQL packs
security-events: write # all workflows
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Cache
uses: actions/cache@v4
with:
key:
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
${{ runner.os }}-pio
path: ${{ matrix.path }}
restore-keys:
${{ runner.os }}-pip-
${{ runner.os }}-pio
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
check-latest: true # is cached version latest?
cache: pip # caching pip dependencies
- name: 'PlatformIO: Install Core'
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: 'PlatformIO: Show Project Config'
run: pio project config
- name: 'PlatformIO: Build Project'
run: pio run