Skip to content

feat(repo): support build on the esp-idf #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .build-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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/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
2 changes: 1 addition & 1 deletion .github/scripts/check_lib_versions.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ check_version_format() {

if [ $# -lt 1 ]; then
latest_version="0.0.0"
echo "Don't get the lastest version, use \"0.0.0\" as default"
echo "Don't get the latest version, use \"0.0.0\" as default"
else
# Get the first input parameter as the version to be compared
latest_version="$1"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/check_lib_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ jobs:
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 }}

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 }}
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'
117 changes: 117 additions & 0 deletions .gitlab/ci/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
.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_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
25 changes: 25 additions & 0 deletions .gitlab/ci/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
push_to_github:
stage: deploy
only:
- master
- /^release\/v/
# when: on_success
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- github_sync
variables:
GIT_STRATEGY: clone
SUBMODULES_TO_FETCH: "none"
dependencies: []
before_script:
- echo "skip default before_script"
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote remove github &>/dev/null || true
- git remote add github [email protected]:esp-arduino-libs/ESP32_Display_Panel.git
- ${COMPONENT_PATH}/.gitlab/tools/push_to_github.sh
21 changes: 21 additions & 0 deletions .gitlab/ci/pre_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.pre_check_template:
stage: pre_check
image: python:3.9
tags: ["build", "amd64", "internet"]
dependencies: []

check_pre_commit:
extends:
- .pre_check_template
before_script:
- pip install pre-commit
script:
- pre-commit run --show-diff-on-failure --color=always --all-files

check_readme_links:
extends:
- .pre_check_template
- .rules:pre_check:readme
allow_failure: true
script:
- python ${CI_PROJECT_DIR}/.gitlab/tools/check_readme_links.py
Loading
Loading