1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-20 21:38:26 +00:00
trezor-firmware/ci/prebuild.yml

80 lines
2.2 KiB
YAML
Raw Normal View History

# Static checks on the code.
2020-06-07 19:49:06 +00:00
image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/trezor-firmware-env.nix
2021-11-24 12:24:10 +00:00
# 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"
2021-11-24 12:24:10 +00:00
<<: *gitlab_caching
script:
- cached-nix-shell --run "poetry run make -j1 style_check"
# Check validity of coin definitions and protobuf files.
common prebuild:
stage: prebuild
2021-11-24 12:24:10 +00:00
<<: *gitlab_caching
script:
- cached-nix-shell --run "poetry run make defs_check"
2019-05-17 13:14:41 +00:00
# Check validity of auto-generated files.
gen prebuild:
2019-05-17 13:14:41 +00:00
stage: prebuild
2021-11-24 12:24:10 +00:00
<<: *gitlab_caching
2019-05-17 13:14:41 +00:00
script:
- cached-nix-shell --run "poetry run make -j1 gen_check"
# Checking format of .editorconfig files.
editor prebuild:
stage: prebuild
2021-11-24 12:24:10 +00:00
<<: *gitlab_caching
script:
- cached-nix-shell --run "make editor_check"
# All .yml/.yaml files are checked for syntax validity and other correctness.
2020-11-11 13:23:28 +00:00
yaml prebuild:
stage: prebuild
2021-11-24 12:24:10 +00:00
<<: *gitlab_caching
2020-11-11 13:23:28 +00:00
script:
- cached-nix-shell --run "poetry run make yaml_check"
2020-11-11 13:23:28 +00:00
# Checking the format of release commit messages.
release commit messages prebuild:
stage: prebuild
2020-08-04 19:21:44 +00:00
before_script: [] # nothing needed
variables:
# We need to clone the repo properly so we can work with origin/master.
2020-08-04 19:21:44 +00:00
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:
- cached-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:
- cached-nix-shell --run "ci/check_changelog.sh"