-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from lovyan03/develop
1.1.12
- Loading branch information
Showing
51 changed files
with
15,953 additions
and
15,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?php | ||
|
||
$max_versions = 3; | ||
$releases = []; | ||
$patch_versions = []; | ||
$idf_fqbns = []; | ||
$idf_versions = []; | ||
$idf_boards = ['esp32', 'esp32s2', 'esp32s3']; | ||
|
||
$git_remote = `git ls-remote https://github.com/espressif/esp-idf`; | ||
|
||
!empty($git_remote) or php_die("bad github response"); | ||
|
||
$lines = explode("\n", $git_remote); | ||
|
||
// get version numbers from enumerated releases | ||
foreach( $lines as $num => $line ) | ||
{ | ||
if( !preg_match("/release/", $line ) ) | ||
continue; // tag or commit | ||
$line = trim($line); | ||
if( empty($line) ) | ||
continue; // EOL or separator | ||
$line_parts = explode("/", trim($line)); // tag name is the last part | ||
if( !empty( $line_parts ) ) | ||
$releases[] = end($line_parts); | ||
} | ||
|
||
!empty($releases) or php_die("releases not found"); | ||
|
||
arsort( $releases ); | ||
|
||
// get version numbers from enumerated tags | ||
foreach( $lines as $num => $line ) | ||
{ | ||
if( !preg_match("/tags/", $line ) ) | ||
continue; | ||
$line = trim($line); | ||
$tag_parts = explode("/", $line ); | ||
$tag_name = end( $tag_parts ); | ||
if( substr( $tag_name, 0, 1 ) == 'v' // esp-idf official tag names are prefixed with "v" | ||
&& substr( $tag_name, -3 ) != '^{}' // ignore commit pointers returned by git ls-remote | ||
/*&& !preg_match( '/beta|dev|rc|head|merge/i', $tag_name)*/ ) // ignore beta/dev/rc and other non significant tags | ||
{ | ||
if(! preg_match("/^v?(0|(?:[1-9]\d*))(?:\.(0|(?:[1-9]\d*))(?:\.(0|(?:[1-9]\d*)))?(?:\-([\w][\w\.\-_]*))?)?$/i", $tag_name, $results ) ) | ||
{ | ||
php_die("Bad semver with entry $num: $tag_name"); | ||
} | ||
unset($results[0]); | ||
$semver = "v".implode('.', $results ); | ||
if( $semver != $tag_name ) | ||
continue; // pattern matching failed with $semver | ||
//php_die("uh oh pattern matching failed with $semver/$tag_name"); | ||
$minor = $results[1].'.'.$results[2]; | ||
$patch = !empty($results[3]) ? $results[1].'.'.$results[2].'.'.$results[3] : ""; | ||
if( !in_array( 'v'.$minor, $releases ) ) | ||
continue; // this tag is not listed in releases | ||
if( !empty($results[3]) && !in_array( $patch, $patch_versions ) ) | ||
$patch_versions[] = $patch; | ||
} | ||
} | ||
|
||
!empty($patch_versions) or php_die("tags not found"); | ||
|
||
arsort( $patch_versions ); | ||
|
||
$max_boards = (count($idf_boards)*$max_versions); | ||
|
||
// match release versions with tag versions | ||
foreach( $releases as $minor ) | ||
{ | ||
$top_version = ''; | ||
foreach( $patch_versions as $patch ) | ||
{ | ||
if( str_starts_with( 'v'.$patch, $minor ) ) | ||
{ | ||
if( $patch > $top_version ) // SEQ comparator on a string is just cheap semver, what could go wrong ? :) | ||
{ | ||
$top_version = $patch; | ||
} | ||
} | ||
} | ||
if( $top_version == '' ) | ||
continue; | ||
|
||
$idf_versions[] = str_replace('v', '', $top_version ); | ||
if( count( $idf_versions ) == $max_versions ) | ||
break; | ||
} | ||
|
||
!empty($idf_versions) or php_die("latest versions not found"); | ||
!empty($idf_boards) or php_die("no board selected"); | ||
|
||
// finally fill matrix json array with jobs | ||
foreach( $idf_versions as $idx => $idf_version ) | ||
{ | ||
if( count( $idf_fqbns ) >= $max_boards ) { | ||
break; | ||
} | ||
foreach( $idf_boards as $idf_board ) { | ||
$idf_fqbns[] = $idf_board.'@'.$idf_version; | ||
} | ||
} | ||
|
||
// add hardcoded versions | ||
$idf_fqbns[] = '[email protected]'; | ||
$idf_fqbns[] = '[email protected]'; | ||
//$idf_fqbns[] = '[email protected]'; | ||
//$idf_fqbns[] = '[email protected]'; | ||
//$idf_fqbns[] = '[email protected]'; | ||
|
||
$json_array = [ "esp-idf-fqbn" => $idf_fqbns ]; | ||
|
||
echo json_encode( $json_array, JSON_PRETTY_PRINT ); | ||
|
||
|
||
function php_die($msg) | ||
{ | ||
echo $msg.PHP_EOL; | ||
exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,47 +14,48 @@ on: | |
- '**.c' | ||
- '**IDFBuild.yml' | ||
- 'CMakeLists.txt' | ||
- 'esp-idf-versions.php' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: idf ${{ matrix.idf-version }}@${{ matrix.idf-board }}>esp-idf_graphicstest | ||
|
||
|
||
set_matrix: | ||
name: Version planner ⊹ | ||
runs-on: ubuntu-latest | ||
env: | ||
max-versions: 3 # maximum core versions to test, starting at latest | ||
outputs: | ||
matrix: ${{steps.set-matrix.outputs.matrix}} | ||
project_dir: ${{steps.set-matrix.outputs.project_dir}} | ||
repo_url: ${{steps.set-matrix.outputs.repo_url}} | ||
|
||
strategy: | ||
matrix: | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
esp-idf-fqbn: | ||
- [email protected] | ||
#- [email protected] # esp-idf tools broken by cython/openOCD | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] # LGFX I2C not ready yet | ||
- name: Setup matrix | ||
id: set-matrix | ||
run: | | ||
matrix=`php .github/scripts/esp-idf-versions.php` | ||
# echo $matrix | jq # debug | ||
matrix="${matrix//'%'/'%25'}" # escape percent entities | ||
matrix="${matrix//$'\n'/''}" # remove lf | ||
matrix="${matrix//$'\r'/''}" # remove cr | ||
echo "matrix=${matrix}" >> $GITHUB_OUTPUT | ||
echo "project_dir=${{env.PROJECT_DIR}}" >> $GITHUB_OUTPUT | ||
echo "repo_url=${{env.REPO_URL}}" >> $GITHUB_OUTPUT | ||
include: | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v4.1 } | ||
#- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v4.2.5 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v4.3.1 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32s2, idf-version: v4.4.4 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32s3, idf-version: v4.4.4 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v5.0 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32s2, idf-version: v5.0 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32s3, idf-version: v5.0 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v5.0.1 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32s2, idf-version: v5.0.1 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32s3, idf-version: v5.0.1 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v5.1 } | ||
- { esp-idf-fqbn: [email protected], idf-board: esp32s3, idf-version: v5.1 } | ||
build: | ||
name: idf ${{ matrix.esp-idf-fqbn }} | ||
needs: set_matrix | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: ${{fromJSON(needs.set_matrix.outputs.matrix)}} | ||
fail-fast: false | ||
|
||
steps: | ||
|
@@ -63,41 +64,45 @@ jobs: | |
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Cache pip for ${{ matrix.esp-idf-fqbn }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ matrix.idf-version }}-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Cache espressif tools for ${{ matrix.esp-idf-fqbn }} | ||
uses: actions/cache@v3 | ||
id: espressif | ||
with: | ||
path: | | ||
~/.espressif | ||
key: ${{ runner.os }}-espressif-${{ matrix.idf-version }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Cache esp-idf for ${{ matrix.esp-idf-fqbn }} | ||
id: cache-idf | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/esp/esp-idf | ||
key: ${{ runner.os }}-idf-${{ matrix.idf-version }}-${{ hashFiles('**/lockfiles') }} | ||
# - name: Cache pip for ${{ matrix.esp-idf-fqbn }} | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: ~/.cache/pip | ||
# key: ${{ runner.os }}-pip-${{ matrix.esp-idf-fqbn }}-${{ hashFiles('**/requirements.txt') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-pip- | ||
# | ||
# - name: Cache espressif tools for ${{ matrix.esp-idf-fqbn }} | ||
# uses: actions/cache@v3 | ||
# id: espressif | ||
# with: | ||
# path: | | ||
# ~/.espressif | ||
# key: ${{ runner.os }}-espressif-${{ matrix.esp-idf-fqbn }}-${{ hashFiles('**/lockfiles') }} | ||
# | ||
# - name: Cache esp-idf for ${{ matrix.esp-idf-fqbn }} | ||
# id: cache-idf | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: ~/esp/esp-idf | ||
# key: ${{ runner.os }}-idf-${{ matrix.esp-idf-fqbn }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Get/Check IDF ${{ matrix.esp-idf-fqbn }} | ||
run: | | ||
mkdir -p ~/esp | ||
cd ~/esp | ||
if [ ! -d "./esp-idf/" ]; then git clone -b ${{ matrix.idf-version }} --recursive $REPO_URL esp-idf; fi | ||
idf_fqbn="${{ matrix.esp-idf-fqbn }}" | ||
idf_version=${idf_fqbn#*@} | ||
if [ ! -d "./esp-idf/" ]; then git clone -b v$idf_version --recursive ${{ needs.set_matrix.outputs.repo_url }} esp-idf; fi | ||
cd ~/esp/esp-idf | ||
if [ ! -d "~/.espressif" ]; then ./install.sh; fi | ||
- name: Build example for ${{ matrix.esp-idf-fqbn }} | ||
run: | | ||
source ~/esp/esp-idf/export.sh | ||
cd ${{ env.PROJECT_DIR }} | ||
idf.py set-target ${{ matrix.idf-board }} | ||
idf_fqbn="${{ matrix.esp-idf-fqbn }}" | ||
idf_board=${idf_fqbn%%@*} | ||
cd ${{ needs.set_matrix.outputs.project_dir }} | ||
idf.py set-target $idf_board | ||
idf.py build | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.