Skip to content

Commit d0beeee

Browse files
authored
Merge pull request #500 from lovyan03/develop
1.1.12
2 parents 302169a + 603d53d commit d0beeee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+15953
-15671
lines changed

.github/scripts/esp-idf-versions.php

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?php
2+
3+
$max_versions = 3;
4+
$releases = [];
5+
$patch_versions = [];
6+
$idf_fqbns = [];
7+
$idf_versions = [];
8+
$idf_boards = ['esp32', 'esp32s2', 'esp32s3'];
9+
10+
$git_remote = `git ls-remote https://github.com/espressif/esp-idf`;
11+
12+
!empty($git_remote) or php_die("bad github response");
13+
14+
$lines = explode("\n", $git_remote);
15+
16+
// get version numbers from enumerated releases
17+
foreach( $lines as $num => $line )
18+
{
19+
if( !preg_match("/release/", $line ) )
20+
continue; // tag or commit
21+
$line = trim($line);
22+
if( empty($line) )
23+
continue; // EOL or separator
24+
$line_parts = explode("/", trim($line)); // tag name is the last part
25+
if( !empty( $line_parts ) )
26+
$releases[] = end($line_parts);
27+
}
28+
29+
!empty($releases) or php_die("releases not found");
30+
31+
arsort( $releases );
32+
33+
// get version numbers from enumerated tags
34+
foreach( $lines as $num => $line )
35+
{
36+
if( !preg_match("/tags/", $line ) )
37+
continue;
38+
$line = trim($line);
39+
$tag_parts = explode("/", $line );
40+
$tag_name = end( $tag_parts );
41+
if( substr( $tag_name, 0, 1 ) == 'v' // esp-idf official tag names are prefixed with "v"
42+
&& substr( $tag_name, -3 ) != '^{}' // ignore commit pointers returned by git ls-remote
43+
/*&& !preg_match( '/beta|dev|rc|head|merge/i', $tag_name)*/ ) // ignore beta/dev/rc and other non significant tags
44+
{
45+
if(! preg_match("/^v?(0|(?:[1-9]\d*))(?:\.(0|(?:[1-9]\d*))(?:\.(0|(?:[1-9]\d*)))?(?:\-([\w][\w\.\-_]*))?)?$/i", $tag_name, $results ) )
46+
{
47+
php_die("Bad semver with entry $num: $tag_name");
48+
}
49+
unset($results[0]);
50+
$semver = "v".implode('.', $results );
51+
if( $semver != $tag_name )
52+
continue; // pattern matching failed with $semver
53+
//php_die("uh oh pattern matching failed with $semver/$tag_name");
54+
$minor = $results[1].'.'.$results[2];
55+
$patch = !empty($results[3]) ? $results[1].'.'.$results[2].'.'.$results[3] : "";
56+
if( !in_array( 'v'.$minor, $releases ) )
57+
continue; // this tag is not listed in releases
58+
if( !empty($results[3]) && !in_array( $patch, $patch_versions ) )
59+
$patch_versions[] = $patch;
60+
}
61+
}
62+
63+
!empty($patch_versions) or php_die("tags not found");
64+
65+
arsort( $patch_versions );
66+
67+
$max_boards = (count($idf_boards)*$max_versions);
68+
69+
// match release versions with tag versions
70+
foreach( $releases as $minor )
71+
{
72+
$top_version = '';
73+
foreach( $patch_versions as $patch )
74+
{
75+
if( str_starts_with( 'v'.$patch, $minor ) )
76+
{
77+
if( $patch > $top_version ) // SEQ comparator on a string is just cheap semver, what could go wrong ? :)
78+
{
79+
$top_version = $patch;
80+
}
81+
}
82+
}
83+
if( $top_version == '' )
84+
continue;
85+
86+
$idf_versions[] = str_replace('v', '', $top_version );
87+
if( count( $idf_versions ) == $max_versions )
88+
break;
89+
}
90+
91+
!empty($idf_versions) or php_die("latest versions not found");
92+
!empty($idf_boards) or php_die("no board selected");
93+
94+
// finally fill matrix json array with jobs
95+
foreach( $idf_versions as $idx => $idf_version )
96+
{
97+
if( count( $idf_fqbns ) >= $max_boards ) {
98+
break;
99+
}
100+
foreach( $idf_boards as $idf_board ) {
101+
$idf_fqbns[] = $idf_board.'@'.$idf_version;
102+
}
103+
}
104+
105+
// add hardcoded versions
106+
$idf_fqbns[] = '[email protected]';
107+
$idf_fqbns[] = '[email protected]';
108+
//$idf_fqbns[] = '[email protected]';
109+
//$idf_fqbns[] = '[email protected]';
110+
//$idf_fqbns[] = '[email protected]';
111+
112+
$json_array = [ "esp-idf-fqbn" => $idf_fqbns ];
113+
114+
echo json_encode( $json_array, JSON_PRETTY_PRINT );
115+
116+
117+
function php_die($msg)
118+
{
119+
echo $msg.PHP_EOL;
120+
exit(1);
121+
}

.github/workflows/ArduinoBuild.yml

+8-19
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525

2626
platform-url:
27-
- https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
27+
- https://espressif.github.io/arduino-esp32/package_esp32_index.json
2828

2929
board:
3030
# ESP32 devices for 3D matrix
@@ -42,10 +42,10 @@ jobs:
4242
#- 2.0.1
4343
#- 2.0.2
4444
#- 2.0.3
45-
- 2.0.4
46-
- 2.0.5
47-
- 2.0.6
48-
- 2.0.7
45+
#- 2.0.4
46+
- 2.0.11
47+
- 2.0.12
48+
- 2.0.13
4949

5050
include:
5151
# 3D matrix doesn't apply to these:
@@ -56,9 +56,9 @@ jobs:
5656
- { board: adafruit_hallowing_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
5757
- { board: adafruit_pybadge_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
5858
- { board: adafruit_pygamer_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
59-
- { board: adafruit_feather_esp32s2_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json', ... }
60-
- { board: adafruit_feather_esp32s3_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json', ... }
61-
- { board: adafruit_funhouse_esp32s2, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json', ... }
59+
- { board: adafruit_feather_esp32s2_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', ... }
60+
- { board: adafruit_feather_esp32s3_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', ... }
61+
- { board: adafruit_funhouse_esp32s2, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', ... }
6262
- { board: rpipico, platform: rp2040, archi: rp2040, platform-version: 2.3.3, cli-args: '--build-property compiler.cpp.extra_flags=-DSKIP_I2C_TEST', platform-url: 'https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json', ... }
6363

6464
# 3D matrix applies to these:
@@ -69,17 +69,6 @@ jobs:
6969
- { board: m5stack-core2, platform: esp32, archi: esp32, ... }
7070
- { board: esp32s3box, platform: esp32, archi: esp32, ... }
7171

72-
exclude:
73-
# 3D matrix excludes these:
74-
#- { board: esp32s3box, platform-version: 1.0.6 }
75-
#- { board: esp32s3box, platform-version: 2.0.0 }
76-
#- { board: esp32s3box, platform-version: 2.0.1 }
77-
#- { board: esp32s3box, platform-version: 2.0.2 }
78-
- { board: esp32s3box, platform-version: 2.0.4 }
79-
#- { board: esp32s2, platform-version: 1.0.6 }
80-
#- { board: esp32s2, platform-version: 2.0.0 }
81-
82-
8372
fail-fast: false
8473

8574
steps:

.github/workflows/IDFBuild.yml

+62-57
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,48 @@ on:
1414
- '**.c'
1515
- '**IDFBuild.yml'
1616
- 'CMakeLists.txt'
17+
- 'esp-idf-versions.php'
1718
pull_request:
19+
workflow_dispatch:
1820

1921
jobs:
20-
build:
21-
name: idf ${{ matrix.idf-version }}@${{ matrix.idf-board }}>esp-idf_graphicstest
2222

23+
24+
set_matrix:
25+
name: Version planner ⊹
2326
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}}
2433

25-
strategy:
26-
matrix:
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
with:
38+
ref: ${{ github.event.pull_request.head.sha }}
2739

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
4251
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
5756

57+
strategy:
58+
matrix: ${{fromJSON(needs.set_matrix.outputs.matrix)}}
5859
fail-fast: false
5960

6061
steps:
@@ -63,41 +64,45 @@ jobs:
6364
with:
6465
ref: ${{ github.event.pull_request.head.sha }}
6566

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') }}
8889

8990
- name: Get/Check IDF ${{ matrix.esp-idf-fqbn }}
9091
run: |
9192
mkdir -p ~/esp
9293
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
9497
cd ~/esp/esp-idf
9598
if [ ! -d "~/.espressif" ]; then ./install.sh; fi
9699
97100
- name: Build example for ${{ matrix.esp-idf-fqbn }}
98101
run: |
99102
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
102107
idf.py build
103108

.github/workflows/PlatformioBuild.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,15 @@ jobs:
3636

3737
platform-version:
3838
- 1.0.6
39-
#- 2.0.4
40-
- 2.0.5
41-
- 2.0.6
42-
- 2.0.7
43-
- 2.0.8
39+
- 2.0.11
40+
- 2.0.12
41+
- 2.0.13
4442
- default
4543

4644
exclude:
4745
- { board: esp32-c3, platform-version: 1.0.6 }
4846
- { board: esp32-s3, platform-version: 1.0.6 }
49-
- { board: esp32-s3, platform-version: default } # 2.0.5 => esp32s3/include/newlib/platform_include/assert.h:20:10: fatal error: sdkconfig.h: No such file or directory
47+
- { board: esp32-s3, platform-version: default }
5048
- { board: esp32-s2, platform-version: 1.0.6 }
5149
- { board: m5stack-cores3, platform-version: 1.0.6 }
5250

0 commit comments

Comments
 (0)