-
Notifications
You must be signed in to change notification settings - Fork 312
/
.gitlab-ci.yml
126 lines (116 loc) · 3.14 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
stages:
- lint
- test
- build
- extension_tests
- deploy
cache:
paths:
- node_modules
before_script:
- test ! -z "$CI_NPM_REGISTRY" && npm config set registry $CI_NPM_REGISTRY || true
- unset HTTP_PROXY
- unset ALL_PROXY
- yarn
- 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
copyright_lint_test:
image: $CI_DOCKER_REGISTRY/python-static-code-analysis
stage: lint
tags: ["build", "internet", "amd64"]
before_script:
- echo "Skipping before_script"
script:
- cd ci && python copyright_header_checker.py -d ../src ../menuconfig -x ../menuconfig/js/lib ../src/views ../src/views/menuconfig -e js ts py
typescript_lint_test:
image: node:slim
stage: lint
tags: ["build", "internet", "amd64"]
script:
- yarn run tslint
node_vulnerabilities_test:
image: node:slim
stage: lint
tags: ["build", "internet", "amd64"]
script:
- yarn audit --registry=https://registry.npmjs.org
allow_failure: true
python_lint_test:
image: $CI_DOCKER_REGISTRY/ubuntu-test-env
stage: lint
tags: ["build", "internet", "amd64"]
artifacts:
when: on_failure
paths:
- flake8_output.txt
- bandit_output.txt
expire_in: 1 week
before_script:
- source /opt/pyenv/activate
- pyenv global 2.7.15
- python -m pip install bandit flake8
script:
- python -m bandit -r -f txt -o bandit_output.txt .
- python -m flake8 --config=.flake8 --output-file=flake8_output.txt --tee
build_vsix:
image: electronuserland/builder:11
stage: build
tags: ["build", "internet", "amd64"]
artifacts:
paths:
- esp-idf-extension-*.vsix
expire_in: 1 week
script:
- yarn config set script-shell /bin/bash
- yarn run package
deploy_marketplace:
image: electronuserland/builder:11
stage: deploy
tags:
- deploy
before_script:
- echo "Skipping before_script"
artifacts:
paths:
- esp-idf-extension-*.vsix
untracked: false
expire_in: 30 days
script:
- yarn config set script-shell /bin/bash
- yarn release
when: manual
deploy_github:
stage: deploy
tags:
- deploy
before_script:
- echo "Skipping 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 git@github.com:espressif/${VSCODE_ESP_IDF_REPO}.git
- cd ci && ./push_to_github.sh
when: manual
tests_extension_units:
image: $CI_DOCKER_REGISTRY/ubuntu-vscode:1-d2303206
stage: extension_tests
tags: ["build", "internet", "amd64"]
artifacts:
paths:
- "*.log"
reports:
junit:
- results/*
when: always
expire_in: 1 week
script:
- Xvfb :99 & sleep 2
- yarn run test --VERBOSE >> testing.results.log