Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab-getlists
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
WP9-T2-SWD-Tools
gitlab-getlists
Commits
6cfd5242
Commit
6cfd5242
authored
2 years ago
by
Szymon Kupinski
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
3ff68aa9
No related branches found
No related tags found
No related merge requests found
Pipeline
#71734
failed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+45
-32
45 additions, 32 deletions
.gitlab-ci.yml
with
45 additions
and
32 deletions
.gitlab-ci.yml
+
45
−
32
View file @
6cfd5242
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/
Getting-Started
.gitlab-ci.yml
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/
Python
.gitlab-ci.yml
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# Official language image. Look for the different tagged releases at:
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# https://hub.docker.com/r/library/python/tags/
# it uses echo commands to simulate the pipeline execution.
image
:
python:latest
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Change pip's cache directory to be inside the project directory since we can
# Stages run in sequential order, but jobs within stages run in parallel.
# only cache local items.
variables
:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/topics/caching/
#
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache
:
paths
:
-
.cache/pip
-
venv/
stages
:
# List of stages for jobs, and their order of execution
before_script
:
-
build
-
python --version
# For debugging
-
test
-
pip install virtualenv
-
deploy
-
virtualenv venv
-
source venv/bin/activate
build-job
:
# This job runs in the build stage, which runs first.
test
:
stage
:
build
script
:
script
:
-
echo "Compiling the code..."
-
python setup.py test
-
echo "Compile complete."
-
pip install tox flake8
# you can also use tox
-
tox -e py36,flake8
unit-test-job
:
# This job runs in the test stage.
run
:
stage
:
test
# It only starts when the job in the build stage completes successfully.
script
:
script
:
-
echo "Running unit tests... This will take about 60 seconds."
-
python setup.py bdist_wheel
-
sleep
60
# an alternative approach is to install and run:
-
echo "Code coverage is 90%"
-
pip install dist/*
# run the command here
artifacts
:
paths
:
-
dist/*.whl
lint-test-job
:
# This job also runs in the test stage.
pages
:
stage
:
test
# It can run at the same time as unit-test-job (in parallel).
script
:
script
:
-
echo "Linting code... This will take about 10 seconds."
-
pip install sphinx sphinx-rtd-theme
-
sleep
10
-
cd doc
-
echo "No lint issues found."
-
make html
-
mv build/html/ ../public/
artifacts
:
paths
:
-
public
rules
:
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy-job
:
# This job runs in the deploy stage.
stage
:
deploy
# It only runs when *both* jobs in the test stage complete successfully.
script
:
-
echo "Deploying application..."
-
echo "Application successfully deployed."
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