14
14
- ' **.c'
15
15
- ' **IDFBuild.yml'
16
16
- ' CMakeLists.txt'
17
+ - ' esp-idf-versions.php'
17
18
pull_request :
19
+ workflow_dispatch :
18
20
19
21
jobs :
20
- build :
21
- name : idf ${{ matrix.idf-version }}@${{ matrix.idf-board }}>esp-idf_graphicstest
22
22
23
+
24
+ set_matrix :
25
+ name : Version planner ⊹
23
26
runs-on : ubuntu-latest
27
+ env :
28
+ max-versions : 3 # maximum core versions to test, starting at latest
29
+ outputs :
30
+ matrix : ${{steps.set-matrix.outputs.matrix}}
31
+ project_dir : ${{steps.set-matrix.outputs.project_dir}}
32
+ repo_url : ${{steps.set-matrix.outputs.repo_url}}
24
33
25
- strategy :
26
- matrix :
34
+ steps :
35
+ - name : Checkout
36
+ uses : actions/checkout@v3
37
+ with :
38
+ ref : ${{ github.event.pull_request.head.sha }}
27
39
28
- esp-idf-fqbn :
29
-
30
- # - [email protected] # esp-idf tools broken by cython/openOCD
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
- -
[email protected] # LGFX I2C not ready yet
40
+ - name : Setup matrix
41
+ id : set-matrix
42
+ run : |
43
+ matrix=`php .github/scripts/esp-idf-versions.php`
44
+ # echo $matrix | jq # debug
45
+ matrix="${matrix//'%'/'%25'}" # escape percent entities
46
+ matrix="${matrix//$'\n'/''}" # remove lf
47
+ matrix="${matrix//$'\r'/''}" # remove cr
48
+ echo "matrix=${matrix}" >> $GITHUB_OUTPUT
49
+ echo "project_dir=${{env.PROJECT_DIR}}" >> $GITHUB_OUTPUT
50
+ echo "repo_url=${{env.REPO_URL}}" >> $GITHUB_OUTPUT
42
51
43
- include :
44
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32, idf-version: v4.1 }
45
- # - { esp-idf-fqbn: [email protected] , idf-board: esp32, idf-version: v4.2.5 }
46
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32, idf-version: v4.3.1 }
47
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32s2, idf-version: v4.4.4 }
48
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32s3, idf-version: v4.4.4 }
49
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32, idf-version: v5.0 }
50
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32s2, idf-version: v5.0 }
51
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32s3, idf-version: v5.0 }
52
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32, idf-version: v5.0.1 }
53
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32s2, idf-version: v5.0.1 }
54
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32s3, idf-version: v5.0.1 }
55
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32, idf-version: v5.1 }
56
- -
{ esp-idf-fqbn: [email protected] , idf-board: esp32s3, idf-version: v5.1 }
52
+ build :
53
+ name : idf ${{ matrix.esp-idf-fqbn }}
54
+ needs : set_matrix
55
+ runs-on : ubuntu-latest
57
56
57
+ strategy :
58
+ matrix : ${{fromJSON(needs.set_matrix.outputs.matrix)}}
58
59
fail-fast : false
59
60
60
61
steps :
@@ -63,41 +64,45 @@ jobs:
63
64
with :
64
65
ref : ${{ github.event.pull_request.head.sha }}
65
66
66
- - name : Cache pip for ${{ matrix.esp-idf-fqbn }}
67
- uses : actions/cache@v3
68
- with :
69
- path : ~/.cache/pip
70
- key : ${{ runner.os }}-pip-${{ matrix.idf-version }}-${{ hashFiles('**/requirements.txt') }}
71
- restore-keys : |
72
- ${{ runner.os }}-pip-
73
-
74
- - name : Cache espressif tools for ${{ matrix.esp-idf-fqbn }}
75
- uses : actions/cache@v3
76
- id : espressif
77
- with :
78
- path : |
79
- ~/.espressif
80
- key : ${{ runner.os }}-espressif-${{ matrix.idf-version }}-${{ hashFiles('**/lockfiles') }}
81
-
82
- - name : Cache esp-idf for ${{ matrix.esp-idf-fqbn }}
83
- id : cache-idf
84
- uses : actions/cache@v3
85
- with :
86
- path : ~/esp/esp-idf
87
- key : ${{ runner.os }}-idf-${{ matrix.idf-version }}-${{ hashFiles('**/lockfiles') }}
67
+ # - name: Cache pip for ${{ matrix.esp-idf-fqbn }}
68
+ # uses: actions/cache@v3
69
+ # with:
70
+ # path: ~/.cache/pip
71
+ # key: ${{ runner.os }}-pip-${{ matrix.esp- idf-fqbn }}-${{ hashFiles('**/requirements.txt') }}
72
+ # restore-keys: |
73
+ # ${{ runner.os }}-pip-
74
+ #
75
+ # - name: Cache espressif tools for ${{ matrix.esp-idf-fqbn }}
76
+ # uses: actions/cache@v3
77
+ # id: espressif
78
+ # with:
79
+ # path: |
80
+ # ~/.espressif
81
+ # key: ${{ runner.os }}-espressif-${{ matrix.esp- idf-fqbn }}-${{ hashFiles('**/lockfiles') }}
82
+ #
83
+ # - name: Cache esp-idf for ${{ matrix.esp-idf-fqbn }}
84
+ # id: cache-idf
85
+ # uses: actions/cache@v3
86
+ # with:
87
+ # path: ~/esp/esp-idf
88
+ # key: ${{ runner.os }}-idf-${{ matrix.esp- idf-fqbn }}-${{ hashFiles('**/lockfiles') }}
88
89
89
90
- name : Get/Check IDF ${{ matrix.esp-idf-fqbn }}
90
91
run : |
91
92
mkdir -p ~/esp
92
93
cd ~/esp
93
- if [ ! -d "./esp-idf/" ]; then git clone -b ${{ matrix.idf-version }} --recursive $REPO_URL esp-idf; fi
94
+ idf_fqbn="${{ matrix.esp-idf-fqbn }}"
95
+ idf_version=${idf_fqbn#*@}
96
+ if [ ! -d "./esp-idf/" ]; then git clone -b v$idf_version --recursive ${{ needs.set_matrix.outputs.repo_url }} esp-idf; fi
94
97
cd ~/esp/esp-idf
95
98
if [ ! -d "~/.espressif" ]; then ./install.sh; fi
96
99
97
100
- name : Build example for ${{ matrix.esp-idf-fqbn }}
98
101
run : |
99
102
source ~/esp/esp-idf/export.sh
100
- cd ${{ env.PROJECT_DIR }}
101
- idf.py set-target ${{ matrix.idf-board }}
103
+ idf_fqbn="${{ matrix.esp-idf-fqbn }}"
104
+ idf_board=${idf_fqbn%%@*}
105
+ cd ${{ needs.set_matrix.outputs.project_dir }}
106
+ idf.py set-target $idf_board
102
107
idf.py build
103
108
0 commit comments