From e6d64f70fa052126191c691ce2b470868582d4bb Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Wed, 9 Jul 2025 08:57:30 -0300 Subject: [PATCH 1/3] ci(gitlab): Initial GitLab setup --- .github/CODEOWNERS | 1 + .gitlab-ci.yml | 25 +++++++++++++++++++++++++ .gitlab/workflows/common.yml | 26 ++++++++++++++++++++++++++ .gitlab/workflows/sample.yml | 6 ++++++ 4 files changed, 58 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 .gitlab/workflows/common.yml create mode 100644 .gitlab/workflows/sample.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 75a2b46d619..64d241ba20a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,6 +11,7 @@ # CI /.github/ @lucasssvaz @me-no-dev @P-R-O-C-H-Y +/.gitlab/ @lucasssvaz /tests/ @lucasssvaz @P-R-O-C-H-Y # Tools diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000000..cc366cec8a8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +workflow: + rules: + # Disable those non-protected push triggered pipelines + - if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"' + when: never + # when running merged result pipelines, CI_COMMIT_SHA represents the temp commit it created. + # Please use PIPELINE_COMMIT_SHA at all places that require a commit sha of the original commit. + - if: $CI_OPEN_MERGE_REQUESTS != null + variables: + PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA + IS_MR_PIPELINE: 1 + - if: $CI_OPEN_MERGE_REQUESTS == null + variables: + PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA + IS_MR_PIPELINE: 0 + - if: '$CI_PIPELINE_SOURCE == "schedule"' + variables: + IS_SCHEDULED_RUN: "true" + - when: always + +# Place the default settings in `.gitlab/workflows/common.yml` instead + +include: + - '.gitlab/workflows/common.yml' + - '.gitlab/workflows/sample.yml' diff --git a/.gitlab/workflows/common.yml b/.gitlab/workflows/common.yml new file mode 100644 index 00000000000..9086da018ab --- /dev/null +++ b/.gitlab/workflows/common.yml @@ -0,0 +1,26 @@ +##################### +# Default Variables # +##################### + +stages: + - pre_check + - build + - test + - result + +variables: + ESP_IDF_VERSION: "5.4" + ESP_ARDUINO_VERSION: "3.2.1" + +############# +# `default` # +############# + +default: + retry: + max: 2 + when: + # In case of a runner failure we could hop to another one, or a network error could go away. + - runner_system_failure + # Job execution timeout may be caused by a network issue. + - job_execution_timeout diff --git a/.gitlab/workflows/sample.yml b/.gitlab/workflows/sample.yml new file mode 100644 index 00000000000..32b6fce042d --- /dev/null +++ b/.gitlab/workflows/sample.yml @@ -0,0 +1,6 @@ +hello-world: + stage: test + script: + - echo "Hello, World from GitLab CI!" + rules: + - if: $CI_PIPELINE_SOURCE == "push" From 1ad43afe811949e64397195f27dfed91aa495602 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Fri, 11 Jul 2025 09:40:13 -0300 Subject: [PATCH 2/3] fix(version): Add to version update script --- .github/scripts/update-version.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/scripts/update-version.sh b/.github/scripts/update-version.sh index 622f2fe8ff8..59a95d01105 100755 --- a/.github/scripts/update-version.sh +++ b/.github/scripts/update-version.sh @@ -45,6 +45,11 @@ cat docs/conf_common.py | \ sed "s/.. |version| replace:: .*/.. |version| replace:: $ESP_ARDUINO_VERSION/g" | \ sed "s/.. |idf_version| replace:: .*/.. |idf_version| replace:: $ESP_IDF_VERSION/g" > docs/__conf_common.py && mv docs/__conf_common.py docs/conf_common.py +echo "Updating .gitlab/workflows/common.yml..." +cat .gitlab/workflows/common.yml | \ +sed "s/ESP_IDF_VERSION:.*/ESP_IDF_VERSION: \"$ESP_IDF_VERSION\"/g" | \ +sed "s/ESP_ARDUINO_VERSION:.*/ESP_ARDUINO_VERSION: \"$ESP_ARDUINO_VERSION\"/g" > .gitlab/workflows/__common.yml && mv .gitlab/workflows/__common.yml .gitlab/workflows/common.yml + echo "Updating cores/esp32/esp_arduino_version.h..." cat cores/esp32/esp_arduino_version.h | \ sed "s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ESP_ARDUINO_VERSION_MAJOR/g" | \ From 9ae21eba7349376dd7f9da8faa2981c697c33809 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 12:15:39 +0000 Subject: [PATCH 3/3] ci(pre-commit): Apply automatic fixes --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cc366cec8a8..89a45022bc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,5 +21,5 @@ workflow: # Place the default settings in `.gitlab/workflows/common.yml` instead include: - - '.gitlab/workflows/common.yml' - - '.gitlab/workflows/sample.yml' + - ".gitlab/workflows/common.yml" + - ".gitlab/workflows/sample.yml"