forked from trezor/trezor-firmware
-
Notifications
You must be signed in to change notification settings - Fork 1
/
prebuild.yml
79 lines (70 loc) · 2.19 KB
/
prebuild.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
# Static checks on the code.
image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/trezor-firmware-env.nix
# Caching
.gitlab_caching: &gitlab_caching
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .venv/
# Check the code for style correctness and perform some static code analysis.
# Biggest part is the python one - using `flake8`, `isort`, `black`, `pylint` and `pyright`,
# also checking Rust files by `rustfmt` and C files by `clang-format`.
# Changelogs formats are checked.
style prebuild:
stage: prebuild
variables:
GIT_SUBMODULE_STRATEGY: "none"
<<: *gitlab_caching
script:
- nix-shell --run "poetry run make style_check"
# Check validity of coin definitions and protobuf files.
common prebuild:
stage: prebuild
<<: *gitlab_caching
script:
- nix-shell --run "poetry run make defs_check"
# Check validity of auto-generated files.
gen prebuild:
stage: prebuild
<<: *gitlab_caching
script:
- nix-shell --run "poetry run make gen_check"
# Checking format of .editorconfig files.
editor prebuild:
stage: prebuild
<<: *gitlab_caching
script:
- nix-shell --run "make editor_check"
# All .yml/.yaml files are checked for syntax validity and other correctness.
yaml prebuild:
stage: prebuild
<<: *gitlab_caching
script:
- nix-shell --run "poetry run make yaml_check"
# Checking the format of release commit messages.
release commit messages prebuild:
stage: prebuild
before_script: [] # nothing needed
variables:
# We need to clone the repo properly so we can work with origin/master.
GIT_STRATEGY: clone
only:
refs:
- /^release\//
variables:
# We want this to run on gitlab.com/satoshilabs/trezor/trezor-firmware only.
- $CI_PROJECT_PATH_SLUG == 'satoshilabs-trezor-trezor-firmware'
script:
- nix-shell --run "ci/check_release_commit_messages.sh"
# Verifying that all commits changing some functionality have a changelog entry
# or contain `[no changelog]` in the commit message.
changelog prebuild:
stage: prebuild
except:
- master
before_script: [] # nothing needed
variables:
GIT_SUBMODULE_STRATEGY: "none"
GIT_STRATEGY: clone
script:
- nix-shell --run "ci/check_changelog.sh"