Skip to content

Commit a3d1759

Browse files
committed
Add CI workflow
1 parent 5ae8575 commit a3d1759

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
jobs:
11+
# Based on action from https://github.com/espressif/esp-bsp/
12+
build-examples:
13+
strategy:
14+
matrix:
15+
include:
16+
- { idf: latest, parallel_count: 5, parallel_index: 1 }
17+
- { idf: release-v5.4, parallel_count: 5, parallel_index: 2 }
18+
name: Build Examples
19+
runs-on: ubuntu-latest
20+
container: espressif/idf:${{ matrix.idf }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with: { submodules: recursive }
25+
- name: Get changed files
26+
if: github.event_name == 'pull_request'
27+
id: changed-files
28+
uses: tj-actions/changed-files@v45
29+
with: { separator: ';' } # Expected format for idf-build-apps
30+
- name: Build examples
31+
if: always()
32+
shell: bash
33+
env:
34+
IDF_EXTRA_ACTIONS_PATH: "${{ github.workspace }}/examples"
35+
ALL_CHANGED_FILES: ${{ (github.event_name != 'pull_request') && format(' ') || format('--modified-files=') }}${{ (github.event_name != 'pull_request') && format(' ') || steps.changed-files.outputs.all_modified_files }}
36+
run: |
37+
. ${IDF_PATH}/export.sh
38+
pip install idf-component-manager==2.2.* ruamel.yaml idf-build-apps==2.4.3 --upgrade
39+
40+
echo "Files changed: "${{env.ALL_CHANGED_FILES}}
41+
idf-build-apps find ${{env.ALL_CHANGED_FILES}}
42+
idf-build-apps build --parallel-count ${{ matrix.parallel_count }} --parallel-index ${{ matrix.parallel_index }} ${{env.ALL_CHANGED_FILES}} --collect-app-info build_info_${{ matrix.idf }}_${{ matrix.parallel_index }}.json

0 commit comments

Comments
 (0)