mirror of
https://github.com/espressif/esp32-wifi-lib.git
synced 2025-08-06 19:44:39 +08:00

- don't add gitlab ssh key in push_master_to_github job - overwrite id_rsa_base64 instead of appending to it
85 lines
3.6 KiB
YAML
Executable File
85 lines
3.6 KiB
YAML
Executable File
stages:
|
|
- check
|
|
- build
|
|
- feature_test
|
|
- deploy
|
|
|
|
variables:
|
|
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
|
|
MAKEFLAGS: "-j8"
|
|
ESPSIGMA_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
|
|
only:
|
|
changes:
|
|
- esp32/lib{coexist,core,espnow,net80211,pp,smartconfig}.a
|
|
- esp32s2/lib{coexist,core,espnow,net80211,pp,smartconfig}.a
|
|
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; do grep $GIT_COMMIT_ID $dir/libcoexist.a; done;
|
|
- for dir in esp32 esp32s2; do grep $GIT_COMMIT_ID $dir/libcore.a; done;
|
|
- for dir in esp32 esp32s2; do grep $GIT_COMMIT_ID $dir/libespnow.a; done;
|
|
- for dir in esp32 esp32s2; do grep $GIT_COMMIT_ID $dir/libespnow.a; done;
|
|
- for dir in esp32 esp32s2; do grep $GIT_COMMIT_ID $dir/libnet80211.a; done;
|
|
- for dir in esp32 esp32s2; do grep $GIT_COMMIT_ID $dir/libpp.a; done;
|
|
- for dir in esp32 esp32s2; do grep $GIT_COMMIT_ID $dir/libsmartconfig.a; done;
|
|
- for dir in esp32 esp32s2; do grep $GIT_COMMIT_ID-remote $dir/libnet80211.a; done;
|
|
- for dir in esp32 esp32s2; do test $(grep $GIT_COMMIT_ID-dirty $dir/*.a | wc -l) -eq 0; done;
|
|
- for dir in esp32 esp32s2; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w printf | wc -l) -eq 0; done;
|
|
- for dir in esp32 esp32s2; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w ets_printf | wc -l) -eq 0; done;
|
|
- for dir in esp32 esp32s2; do if [ -e $dir/libwps.a ]; then exit 1; fi; done;
|
|
- for dir in esp32 esp32s2; do if [ -e $dir/libwpa.a ]; then exit 1; fi; done;
|
|
- for dir in esp32 esp32s2; do if [ -e $dir/libwpa2.a ]; then exit 1; fi; done;
|
|
|
|
push_master_to_github:
|
|
stage: deploy
|
|
tags:
|
|
- github_sync
|
|
only:
|
|
- master
|
|
- /^release\/v/
|
|
# when: on_success
|
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env
|
|
variables:
|
|
GIT_STRATEGY: clone
|
|
GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
|
|
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 add github git@github.com:espressif/esp32-wifi-lib.git
|
|
# What the next line of script does: goes through the list of refs for all branches we push to github,
|
|
# generates a snippet of shell which is evaluated. The snippet checks CI_BUILD_REF against the SHA
|
|
# (aka objectname) at tip of each branch, and if any SHAs match then it checks out the local branch
|
|
# and then pushes that ref to a corresponding github branch
|
|
#
|
|
# NB: In gitlab 9.x, CI_BUILD_REF was deprecated. New name is CI_COMMIT_REF. If below command suddenly
|
|
# generates bash syntax errors, this is probably why.
|
|
- eval $(git for-each-ref --shell bash --format 'if [ $CI_BUILD_REF == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)
|
|
|
|
include:
|
|
- 'tools/ci/config/build.yml'
|
|
- 'tools/ci/config/feature_test.yml'
|