-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (38 loc) · 1.49 KB
/
examples.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
name: Smoke-test examples
on: [push, pull_request]
jobs:
find-examples: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
dir: ${{ steps.set-dirs.outputs.dir }} # generate output name dir by using inner step output
steps:
- uses: actions/checkout@v2
- id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
run: echo "::set-output name=dir::$(find . -name platformio.ini -print0 |xargs -0 -n 1 dirname | jq -R -s -c 'split("\n")[:-1]')"
# Define step output named dir base on ls command transformed to JSON thanks to jq
build:
needs: [find-examples] # Depends on previous job
strategy:
fail-fast: false
matrix:
example: ${{fromJson(needs.find-examples.outputs.dir)}}
# packages not yet uploaded :(
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U https://github.com/platformio/platformio/archive/develop.zip
platformio platform install https://github.com/Community-PIO-CH32V/platform-ch32v.git
- name: Build examples
run: |
platformio run -d ${{ matrix.example }}