Skip to content

ci(gitlab): Initial GitLab setup #11576

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 1 commit 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
25 changes: 25 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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'
26 changes: 26 additions & 0 deletions .gitlab/workflows/common.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .gitlab/workflows/sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hello-world:
stage: test
script:
- echo "Hello, World from GitLab CI!"
rules:
- when: always