Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Blanke
AKPlanning
Commits
6647f4c7
Commit
6647f4c7
authored
1 year ago
by
Benjamin Hättasch
Browse files
Options
Downloads
Patches
Plain Diff
Add linting to CI pipeline
parent
3984e086
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+33
-0
33 additions, 0 deletions
.gitlab-ci.yml
with
33 additions
and
0 deletions
.gitlab-ci.yml
+
33
−
0
View file @
6647f4c7
...
...
@@ -20,6 +20,10 @@ before_script:
-
apt-get -qq install -y python3-virtualenv python3 python3-dev python3-pip gettext default-mysql-client default-libmysqlclient-dev
-
export DJANGO_SETTINGS_MODULE=AKPlanning.settings_ci
-
./Utils/setup.sh --prod
-
mkdir -p public/badges public/lint
-
echo undefined > public/badges/$CI_JOB_NAME.score
-
source venv/bin/activate
-
pip install pylint-gitlab
-
mysql --version
check
:
...
...
@@ -48,3 +52,32 @@ test:
coverage_format
:
cobertura
path
:
coverage.xml
junit
:
unit.xml
lint
:
stage
:
test
script
:
-
pylint --exit-zero --output-format=text $(find -type f -name "*.py" ! -path "**/venv/**") | tee /tmp/pylint.txt
-
sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pylint.txt > public/badges/$CI_JOB_NAME.score
-
pylint --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter $(find -type f -name "*.py" ! -path "**/venv/**") > codeclimate.json
-
pylint --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter $(find -type f -name "*.py" ! -path "**/venv/**") > public/lint/index.html
after_script
:
-
|
echo "Linting score: $(cat public/badges/$CI_JOB_NAME.score)"
artifacts
:
paths
:
-
public
reports
:
codequality
:
codeclimate.json
when
:
always
pages
:
stage
:
deploy
image
:
alpine:latest
script
:
-
echo
artifacts
:
paths
:
-
public
only
:
refs
:
-
main
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment