Skip to content

Commit

Permalink
feat(repo): support build on the esp-idf
Browse files Browse the repository at this point in the history
  • Loading branch information
Lzw655 committed Nov 5, 2024
1 parent a66b165 commit f74f6a7
Show file tree
Hide file tree
Showing 238 changed files with 8,788 additions and 1,845 deletions.
48 changes: 48 additions & 0 deletions .build-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Note: All operators are binary operators. For more than two operands, you may use the nested parentheses trick.
# For example:
# * A == 1 or (B == 2 and C in [1,2,3])
# * (A == 1 and B == 2) or (C not in ["3", "4", 5])

# Test apps
test_apps/lcd/3wire_spi_rgb:
disable:
- if: SOC_LCD_RGB_SUPPORTED != 1
- if: IDF_TARGET == "esp32p4"
temporary: true
reason: not ready

test_apps/lcd/qspi:
disable:
- if: SOC_GPSPI_SUPPORTED != 1

test_apps/lcd/rgb:
disable:
- if: SOC_LCD_RGB_SUPPORTED != 1
- if: IDF_TARGET == "esp32p4"
temporary: true
reason: not ready

test_apps/lcd/spi:
disable:
- if: SOC_GPSPI_SUPPORTED != 1

test_apps/lvgl_port:
enable:
- if: INCLUDE_DEFAULT == 1

test_apps/panel:
enable:
- if: INCLUDE_DEFAULT == 1

test_apps/touch/i2c:
disable:
- if: SOC_I2C_SUPPORTED != 1

test_apps/touch/spi:
disable:
- if: SOC_GPSPI_SUPPORTED != 1

# Examples
# examples/esp_idf/esp_brookesia_phone_m5stace_core_s3:
# enable:
# - if: IDF_TARGET in ["esp32s3"]
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
skip = ./src/touch/base/esp_lcd_touch_xpt2046.c
46 changes: 26 additions & 20 deletions .github/scripts/check_lib_versions.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ check_version_format() {
return 0
}

if [ $# -lt 1 ]; then
latest_version="0.0.0"
echo "Don't get the lastest version, use \"0.0.0\" as default"
else
# Get the first input parameter as the version to be compared
latest_version="$1"
# Check the version format
check_version_format "${latest_version}"
result=$?
if [ ${result} -ne 0 ]; then
echo "The latest release version (${latest_version}) format is incorrect."
exit 1
fi
fi

# Specify the directory path
target_directory="./"

echo "Checking directory: ${target_directory}"

# Function: Check if a file exists
# Input parameters: $1 The file to check
# Return value: 0 if the file exists, 1 if the file does not exist
Expand Down Expand Up @@ -68,6 +48,32 @@ compare_versions() {
return 0
}

# Get the latest release version
latest_version="v0.0.0"
for i in "$@"; do
case $i in
--latest_version=*)
latest_version="${i#*=}"
shift
;;
*)
;;
esac
done
# Check the version format
check_version_format "${latest_version}"
result=$?
if [ ${result} -ne 0 ]; then
echo "The latest release version (${latest_version}) format is incorrect."
exit 1
fi
echo "Get the latest release version: ${latest_version}"

# Specify the directory path
target_directory="./"

echo "Checking directory: ${target_directory}"

echo "Checking file: library.properties"
# Check if "library.properties" file exists
check_file_exists "${target_directory}/library.properties"
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/check_lib_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [opened, reopened, synchronize]

jobs:
check_versions:
check_lib_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -26,5 +26,4 @@ jobs:
echo "prerelease: ${{ steps.last_release.outputs.prerelease }}"
echo "url: ${{ steps.last_release.outputs.url }}"
- name: Check & Compare versions
run: bash ./.github/scripts/check_lib_versions.sh ${{ steps.last_release.outputs.tag_name }}

run: bash ./.github/scripts/check_lib_versions.sh --latest_version=${{ steps.last_release.outputs.tag_name }}
24 changes: 24 additions & 0 deletions .github/workflows/issue_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Sync issue comments to JIRA

# This workflow will be triggered when new issue comment is created (including PR comments)
on: issue_comment

# Limit to single concurrent run for workflows which can create Jira issues.
# Same concurrency group is used in new_issues.yml
concurrency: jira_issues

jobs:
sync_issue_comments_to_jira:
name: Sync Issue Comments to Jira
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Sync issue comments to JIRA
uses: espressif/github-actions/sync_issues_to_jira@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_COMPONENT: ${{ secrets.JIRA_COMPONENT }}
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
24 changes: 24 additions & 0 deletions .github/workflows/new_issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Sync issues to Jira

# This workflow will be triggered when a new issue is opened
on: issues

# Limit to single concurrent run for workflows which can create Jira issues.
# Same concurrency group is used in issue_comment.yml
concurrency: jira_issues

jobs:
sync_issues_to_jira:
name: Sync issues to Jira
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Sync GitHub issues to Jira project
uses: espressif/github-actions/sync_issues_to_jira@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_COMPONENT: ${{ secrets.JIRA_COMPONENT }}
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
29 changes: 29 additions & 0 deletions .github/workflows/new_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Sync remain PRs to Jira

# This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project
# Note that, PRs can also get synced when new PR comment is created
on:
schedule:
- cron: "0 * * * *"

# Limit to single concurrent run for workflows which can create Jira issues.
# Same concurrency group is used in issue_comment.yml
concurrency: jira_issues

jobs:
sync_prs_to_jira:
name: Sync PRs to Jira
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Sync PRs to Jira project
uses: espressif/github-actions/sync_issues_to_jira@master
with:
cron_job: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_COMPONENT: ${{ secrets.JIRA_COMPONENT }}
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
20 changes: 20 additions & 0 deletions .github/workflows/upload_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Push components to Espressif Component Service

on:
workflow_dispatch:
release:
types: [published]

jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
submodules: 'recursive'
- name: Upload components to component service
uses: espressif/upload-components-ci-action@v1
with:
name: "ESP32_Display_Panel"
namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
28 changes: 28 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
stages:
- pre_check
- build
- deploy

workflow:
rules:
# Disable those non-protected push triggered pipelines
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
when: never
# when running merged result pipelines, it would create a temp commit id. use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA instead of $CI_COMMIT_SHA.
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha
- if: $CI_OPEN_MERGE_REQUESTS != null
variables:
PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
- if: $CI_OPEN_MERGE_REQUESTS == null
variables:
PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
- when: always

variables:
COMPONENT_PATH: "$CI_PROJECT_DIR"

include:
- '.gitlab/ci/rules.yml'
- '.gitlab/ci/pre_check.yml'
- '.gitlab/ci/build.yml'
- '.gitlab/ci/deploy.yml'
125 changes: 125 additions & 0 deletions .gitlab/ci/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
.build_template: &build_template
stage: build
tags:
- build
image: ${IMAGE}
variables:
# Enable ccache for all build jobs. See configure_ci_environment.sh for more ccache related settings.
IDF_CCACHE_ENABLE: "1"
BATCH_BUILD: "1"
V: "0"
WARNING_STR: ""

.build_examples_template: &build_examples_template
<<: *build_template
artifacts:
when: always
paths:
- "**/build*/size.json"
- "**/build*/build_log.txt"
- "**/build*/*.bin"
# upload to s3 server to save the artifacts size
- "**/build*/*.map"
- "**/build*/*.elf"
- "**/build*/flasher_args.json"
- "**/build*/flash_args"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
- "**/build*/bootloader/*.bin"
- "**/build*/bootloader/*.elf"
- "**/build*/partition_table/*.bin"
- "**/build*/mmap_build/*.bin"
- "**/build*/**/*.bin"
- size_info.txt
expire_in: 1 week
variables:
IDF_CI_BUILD: "1"
# By configuring this macro, you can append the compiled configuration file.
# For example, using "sdkconf.etc=default" specifies the default sdkconfig file.
EXAMPLE_CONFIG: "="
script:
- pip install "idf-component-manager"
- pip install idf_build_apps
- python .gitlab/tools/build_apps.py ${EXAMPLE_DIR} --config ${EXAMPLE_CONFIG} -t all -vv

# Target ESP-IDF versions
.build_idf_active_release_version:
parallel:
matrix:
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
- IMAGE: espressif/idf:release-v5.3

# Test apps
build_test_apps_lcd_3wire_spi_rgb:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_lcd_3wire_spi_rgb
variables:
EXAMPLE_DIR: test_apps/lcd/3wire_spi_rgb

build_test_apps_lcd_qspi:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_lcd_qspi
variables:
EXAMPLE_DIR: test_apps/lcd/qspi

build_test_apps_lcd_rgb:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_lcd_rgb
variables:
EXAMPLE_DIR: test_apps/lcd/rgb

build_test_apps_lcd_spi:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_lcd_spi
variables:
EXAMPLE_DIR: test_apps/lcd/spi

build_test_apps_lvgl_port:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_lvgl_port
variables:
EXAMPLE_DIR: test_apps/lvgl_port

build_test_apps_panel:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_panel
variables:
EXAMPLE_DIR: test_apps/panel

build_test_apps_touch_i2c:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_touch_i2c
variables:
EXAMPLE_DIR: test_apps/touch/i2c

build_test_apps_touch_spi:
extends:
- .build_examples_template
- .build_idf_active_release_version
- .rules:build:test_apps_touch_spi
variables:
EXAMPLE_DIR: test_apps/touch/spi

# Examples
# build_example_esp_brookesia_phone_m5stace_core_s3:
# extends:
# - .build_examples_template
# - .build_esp32_s3_idf_release_version
# - .rules:build:example_esp_brookesia_phone_m5stace_core_s3
# variables:
# EXAMPLE_DIR: examples/esp_idf/esp_brookesia_phone_m5stace_core_s3
Loading

0 comments on commit f74f6a7

Please sign in to comment.