-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
43 lines (38 loc) · 1.44 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
include:
- project: 'espressif/shared-ci-dangerjs'
ref: master
file: 'danger.yaml'
stages:
- danger
- codecheck
# 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.8-bullseye
tags:
- build
- internet
before_script:
- pip install -e .[dev] --prefer-binary
# ------------------------------------------------------------------------------------------------------
# JOBS
# ------------------------------------------------------------------------------------------------------
# CODE CHECK BY PRE-COMMIT HOOKS
pre-commit_hooks_MR:
extends: .base_template
stage: codecheck
script:
- apt-get update && apt-get install -y -q git
- 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"'
# ------------------------------------------------------------------------------------------------------