-
Notifications
You must be signed in to change notification settings - Fork 71
/
.gitlab-ci.yml
executable file
·80 lines (76 loc) · 3.76 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
stages:
- check
- build
- feature_test
- deploy
variables:
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
MAKEFLAGS: "-j8"
SSC_BRANCH: "master"
IDF_BRANCH: "master"
board: "esp32"
before_script:
# Add gitlab ssh key
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
check_lib_reversion:
stage: check
except:
- master
- /^release\/v/
image: $CI_DOCKER_REGISTRY/esp32-ci-env
script:
- GIT_COMMIT_ID=`git log --pretty="%s" -1 | grep -o '([0-9a-f]*)' | tail -1 | cut -c 2-8`
- echo "GIT_COMMIT_ID is "$GIT_COMMIT_ID
- test $(echo -n $GIT_COMMIT_ID | wc -c) -eq 7
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID $dir/libcore.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID $dir/libespnow.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID $dir/libmesh.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID $dir/libnet80211.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID $dir/libpp.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID $dir/libsmartconfig.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID $dir/libwapi.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do grep $GIT_COMMIT_ID-remote $dir/libnet80211.a; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do test $(grep $GIT_COMMIT_ID-dirty $dir/*.a | wc -l) -eq 0; done;
- for dir in esp32 esp32s2 esp32s3; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w printf | wc -l) -eq 0; done;
- for dir in esp32 esp32s2 esp32s3; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w ets_printf | wc -l) -eq 0; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do if [ -e $dir/libwps.a ]; then exit 1; fi; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do if [ -e $dir/libwpa.a ]; then exit 1; fi; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do if [ -e $dir/libwpa2.a ]; then exit 1; fi; done;
- for dir in esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6 esp32c5 esp32_host; do cd $dir; for filename in *; do if [[ -x "$file" ]]; then echo "Execute permissions for $dir/$filename"; exit 1; fi; done; cd .. ; done
push_master_to_github:
stage: deploy
tags:
- github_sync
only:
- master
- /^release\/v/
- /^v\d+\.\d+/
# when: on_success
image: $CI_DOCKER_REGISTRY/esp32-ci-env
variables:
GIT_DEPTH: 0
before_script: []
script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git remote remove github &>/dev/null || true
- git remote add github [email protected]:espressif/esp32-wifi-lib.git
# Ref: esp-idf tools/ci/push_to_github.sh
- |
if [ -n "${CI_COMMIT_TAG}" ]; then
git push github "${CI_COMMIT_TAG}"
else
git push github "${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
fi
include:
- 'tools/ci/config/build.yml'
- 'tools/ci/config/feature_test.yml'