-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
83 lines (83 loc) · 2.58 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
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages:
- lint
- unittest
- test
- release
include:
- template: Code-Quality.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
python-safety:
stage: test
needs: ["pytest"]
image: pipelinecomponents/python-safety:latest
script:
- safety check --full-report -r requirements.txt
pylint:
stage: lint
image: python:3.9
before_script:
- pip install pylint pylint-exit anybadge
- pip install -r requirements.txt
script:
- mkdir ./pylint
- pylint ./ffxiv.py --ignore=. --output-format=text . | tee ./pylint/pylint.log || pylint-exit $?
- PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
- anybadge --label=Pylint --file=pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green
- echo "Pylint score is $PYLINT_SCORE"
artifacts:
paths:
- ./pylint/
pytest:
image: python:3.9
stage: unittest
needs: ["pylint"]
before_script:
- pip install pytest
- pip install -r requirements.txt
script:
- pytest --junitxml=report.xml
artifacts:
when: always
reports:
junit: report.xml
release:
image: node:14
stage: release
needs: ["pytest"]
only:
refs:
- main
script:
- npm install -g semantic-release
- npm install -g semantic-release @semantic-release/git
- npm install -g semantic-release @semantic-release/gitlab
- npm install -g semantic-release @semantic-release/gitlab-config
- npm install -g semantic-release @semantic-release/changelog
- npm install -g semantic-release @semantic-release/exec
- semantic-release -e @semantic-release/gitlab-config
create-wiki:
image: python:3.9
stage: release
needs: ["pytest"]
only:
refs:
- main
script:
- pip install pdoc
#- git clone https://oauth2:${WIKI_TOKEN}@s2.behead.de/git/ffxiv-scapy-layer.git
#- cd ffxiv-scapy-layer
- pip install -r requirements.txt
- mkdir docs
- pdoc --no-search ffxiv.py -o ./docs
artifacts:
paths:
- ./docs/
sast:
stage: test
needs: ["pytest"]