Skip to content
Snippets Groups Projects
Unverified Commit 10ba0f30 authored by Maximilian Gerhardt's avatar Maximilian Gerhardt Committed by GitHub
Browse files

PlatformIO build fixes and improvements (#134)

* Fix caching
* Create requirements.txt
* Fix PlatformIO build for Wiring examples, use cache properly
* Remove uneeded file
* Add slightly more into PlatformIO ini
parent 78268a85
No related branches found
No related tags found
No related merge requests found
......@@ -35,25 +35,16 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: pio run
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO Project
run: pio run
\ No newline at end of file
......@@ -17,7 +17,13 @@ extends = fun_base
board_build.ldscript = ch32v003fun/ch32v003fun.ld
build_flags = -flto -Ich32v003fun -I/usr/include/newlib -DTINYVECTOR -lgcc -Iextralibs
build_src_filter = +<ch32v003fun>
extra_libs_srcs = +<extralibs>
; If creating a new example:
; 1. Add new [env:name]
; 2. Add build_src_filter with fun base files + example folder (+ extra libraries if used) for source files
; 3. Add additional build flags as needed (see uartdemo)
; 4. Switch to new environment in VSCode bottom taskbar (https://docs.platformio.org/en/latest/integration/ide/vscode.html#project-tasks)
[env:blink]
build_src_filter = ${fun_base.build_src_filter} +<examples/blink>
......@@ -30,6 +36,12 @@ build_src_filter = ${fun_base.build_src_filter} +<examples/debugprintfdemo>
[env:external_crystal]
build_src_filter = ${fun_base.build_src_filter} +<examples/external_crystal>
[env:GPIO]
build_src_filter = ${fun_base.build_src_filter} ${fun_base.extra_libs_srcs} +<examples/GPIO>
[env:GPIO_analogRead]
build_src_filter = ${fun_base.build_src_filter} ${fun_base.extra_libs_srcs} +<examples/GPIO_analogRead>
[env:optionbytes]
build_src_filter = ${fun_base.build_src_filter} +<examples/optionbytes>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment