forked from espressif/esp-coredump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
76 lines (66 loc) · 2.3 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
stages:
- codecheck
- release
# WORKFLOW RULES
# ------------------------------------------------------------------------------------------------------
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"'
when: never
- if: '$CI_COMMIT_BRANCH'
# ------------------------------------------------------------------------------------------------------
# TEMPLATES
# ------------------------------------------------------------------------------------------------------
.base_template:
image: python:3.7-slim-buster
tags:
- build
- internet
# --------------------------------------------------------------------------------------------------
# JOBS
# ------------------------------------------------------------------------------------------------------
# CODE CHECK BY PRE-COMMIT HOOKS
pre-commit_hooks_MR:
stage: codecheck
extends: .base_template
before_script:
- apt-get update && apt-get install -y -q git
- python -m pip install pre-commit
script:
- git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | xargs pre-commit run --files
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
# Check if parse_soc_h_script got changed on IDF side
parse_soc_h_script_check:
stage: codecheck
image: espressif/idf:latest
tags:
- build
- internet
script:
- pip install .
- python esp_coredump/corefile/_parse_soc_header.py
- git diff --exit-code -- esp_coredump/corefile/soc_headers/\* || exit 1;
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
# Publish a PyPI package
pypi:
stage: release
extends: .base_template
before_script:
- python -m pip install --upgrade pip
- python -m pip install setuptools twine
variables:
TWINE_NON_INTERACTIVE: "true"
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${PYPI_ESP_COREDUMP_TOKEN}
script:
- echo "Packaging espcoredump"
- python setup.py sdist
- python -m pip download esp-coredump==$(python setup.py -V) && exit 0
- echo "Publishing new espcoredump version"
- python -m twine upload dist/*
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# ------------------------------------------------------------------------------------------------------