From 48f002294934986bd4b9cd96260df5c9704da18b 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] ci(gitlab): Initial GitLab setup --- .gitlab-ci.yml | 25 +++++++++++++++++++++++++ .gitlab/workflows/common.yml | 26 ++++++++++++++++++++++++++ .gitlab/workflows/sample.yml | 6 ++++++ 3 files changed, 57 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 .gitlab/workflows/common.yml create mode 100644 .gitlab/workflows/sample.yml 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..ed3695c5ae1 --- /dev/null +++ b/.gitlab/workflows/sample.yml @@ -0,0 +1,6 @@ +hello-world: + stage: test + script: + - echo "Hello, World from GitLab CI!" + rules: + - when: always