forked from espressif/esp-lwip
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
55 lines (48 loc) · 1.88 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
stages:
- host_test
- deploy
image: ${CI_DOCKER_REGISTRY}/esp32-ci-env
variables:
# tag in lwip-contrib repo, which supports our esp-lwip branch (and it's cherry-picked commits from release branches)
LWIP_CONTRIB_TAG: STABLE-2_0_1_RELEASE
# test timeout is seconds
TEST_TIMEOUT: 200
before_script:
# Use CI Tools
- curl -sSL ${CIT_LOADER_URL} | sh
- source citools/import_functions
run_lwip_unittests:
stage: host_test
tags:
- host_test
dependencies: []
script:
# have to clone lwip-contrib repo, as it contains unit test infrastructure
- cit_add_ssh_key "${GITLAB_KEY}" "$(cit_parse_url_host ${LWIP_CONTRIB_MIRROR})" "$(cit_parse_url_port ${LWIP_CONTRIB_MIRROR})"
- git clone "${LWIP_CONTRIB_MIRROR}" lwip-contrib && cd lwip-contrib && git checkout tags/${LWIP_CONTRIB_TAG}
- cd ports/unix/check/
# updating environment
- export LWIPDIR=../../../../src && export CK_DEFAULT_TIMEOUT=${TEST_TIMEOUT}
- export TESTFILES=`find $LWIPDIR/../test/unit -name '*.c' | tr '\n' ' '`
- export CFLAGS=-I$LWIPDIR/../test/unit/esp
# build and run tests
- make "TESTFILES=$TESTFILES" check
.add_gh_key_remote: &add_gh_key_remote |
command -v ssh-agent >/dev/null || exit 1
eval $(ssh-agent -s)
printf '%s\n' "${GH_PUSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh && chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config || ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git remote remove github || true
git remote add github ${GH_PUSH_REPO}
push_master_to_github:
stage: deploy
only:
- 2.0.3-esp
when: on_success
variables:
GIT_STRATEGY: clone
script:
- *add_gh_key_remote
- "[ -n \"${CI_COMMIT_TAG:-}\" ] && git push github ${CI_COMMIT_TAG}"
- "[ -z \"${CI_COMMIT_TAG:-}\" ] && git push github ${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"