Skip to content

Commit e6d64f7

Browse files
committed
ci(gitlab): Initial GitLab setup
1 parent 87b718a commit e6d64f7

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# CI
1313
/.github/ @lucasssvaz @me-no-dev @P-R-O-C-H-Y
14+
/.gitlab/ @lucasssvaz
1415
/tests/ @lucasssvaz @P-R-O-C-H-Y
1516

1617
# Tools

.gitlab-ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
workflow:
2+
rules:
3+
# Disable those non-protected push triggered pipelines
4+
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
5+
when: never
6+
# when running merged result pipelines, CI_COMMIT_SHA represents the temp commit it created.
7+
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha of the original commit.
8+
- if: $CI_OPEN_MERGE_REQUESTS != null
9+
variables:
10+
PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
11+
IS_MR_PIPELINE: 1
12+
- if: $CI_OPEN_MERGE_REQUESTS == null
13+
variables:
14+
PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
15+
IS_MR_PIPELINE: 0
16+
- if: '$CI_PIPELINE_SOURCE == "schedule"'
17+
variables:
18+
IS_SCHEDULED_RUN: "true"
19+
- when: always
20+
21+
# Place the default settings in `.gitlab/workflows/common.yml` instead
22+
23+
include:
24+
- '.gitlab/workflows/common.yml'
25+
- '.gitlab/workflows/sample.yml'

.gitlab/workflows/common.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#####################
2+
# Default Variables #
3+
#####################
4+
5+
stages:
6+
- pre_check
7+
- build
8+
- test
9+
- result
10+
11+
variables:
12+
ESP_IDF_VERSION: "5.4"
13+
ESP_ARDUINO_VERSION: "3.2.1"
14+
15+
#############
16+
# `default` #
17+
#############
18+
19+
default:
20+
retry:
21+
max: 2
22+
when:
23+
# In case of a runner failure we could hop to another one, or a network error could go away.
24+
- runner_system_failure
25+
# Job execution timeout may be caused by a network issue.
26+
- job_execution_timeout

.gitlab/workflows/sample.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
hello-world:
2+
stage: test
3+
script:
4+
- echo "Hello, World from GitLab CI!"
5+
rules:
6+
- if: $CI_PIPELINE_SOURCE == "push"

0 commit comments

Comments
 (0)