forked from espressif/esp-adf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
82 lines (77 loc) · 2.58 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
stages:
- pre_check
- build
- assign_test
- target_test
- deploy
variables:
# System environment
# Common parameters for the 'make' during CI tests
MAKEFLAGS: "-j5 --no-keep-going"
# more attempts for more robust
GET_SOURCES_ATTEMPTS: "10"
ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: none
ADF_PATH: "$CI_PROJECT_DIR"
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
ADF_TEST_PACKAGE_PATH: "${ADF_PATH}/tools/adf_test_package"
CI_TARGET_UT_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-ut-test.yml"
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-test.yml"
IDF_SKIP_CHECK_SUBMODULES: 1
GIT_DEPTH: 1
.execute_submodules: &execute_submodules |
if [[ "$DEEP_CLONE" == "true" ]]; then
git submodule update --init;
else
git -c submodule."esp-idf".update=none submodule update --init;
git submodule | grep esp-idf;
export ORIG_HEAD=`git submodule | grep "esp-idf" | sed -r 's/-(.*) esp-idf/\1/g' | awk '{print $1}'`;
echo ${ORIG_HEAD};
rm esp-idf -rf; mkdir esp-idf;
cd esp-idf; git init;
git remote add origin ${GITLAB_SSH_SERVER}/idf/esp-idf.git;
git fetch origin ${ORIG_HEAD}:${ORIG_HEAD} --depth 1;
git checkout ${ORIG_HEAD};
cd -;
fi
before_script:
- source $ADF_PATH/tools/ci/utils.sh
- add_gitlab_ssh_keys
# replace submodule to internal repository to speedup cloning
- update_submodule_remote
- *execute_submodules
# To disable set -e for automatic error detection, due to the switch_branch.sh use $? check return value
- source $ADF_PATH/tools/ci/switch_branch.sh
# - source esp-idf/tools/ci/configure_ci_environment.sh
push_to_github:
stage: deploy
rules:
- if:
'($CI_COMMIT_REF_NAME == "master" ||
$CI_COMMIT_BRANCH =~ /^release\/v/ ||
$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) &&
$CI_PIPELINE_SOURCE != "schedule"'
when: on_success
image: $CI_DOCKER_REGISTRY/esp32-ci-env
variables:
GIT_STRATEGY: clone
before_script:
- echo "skip default before_script"
script:
- source $ADF_PATH/tools/ci/utils.sh
- add_github_ssh_keys
- git fetch --unshallow
- git remote remove github &>/dev/null || true
- git remote add github git@github.com:espressif/esp-adf.git
- tools/ci/push_to_github.sh
include:
- '.gitlab/ci/rules.yml'
- '.gitlab/ci/docs.yml'
- '.gitlab/ci/pre-check.yml'
- '.gitlab/ci/build-ut.yml'
- '.gitlab/ci/build-examples-v5-x.yml'
- '.gitlab/ci/build-examples.yml'
- '.gitlab/ci/assign-test.yml'
- '.gitlab/ci/target-ut-test.yml'
- '.gitlab/ci/target-examples-test-v5-x.yml'