Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PTR-MS
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
EBAS-DATA-PROCESSING
CiGas-processing-software
PTR-MS
Commits
7184c07b
Commit
7184c07b
authored
7 months ago
by
Marc-Antoine Drouin
Browse files
Options
Downloads
Patches
Plain Diff
ci: add CI configuration
parent
57a5114b
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
+124
-0
124 additions, 0 deletions
.gitlab-ci.yml
with
124 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
124
−
0
View file @
7184c07b
variables
:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
# https://pip.pypa.io/en/stable/topics/caching/
cache
:
paths
:
-
.cache/pip
-
.cache/pre-commit
before_script
:
-
python --version ; pip --version
-
pip install virtualenv
-
virtualenv venv
-
source venv/bin/activate
stages
:
-
quality
-
test
-
release
-
docs
pre-commit
:
stage
:
quality
image
:
python:3.12
script
:
-
pip install pre-commit
-
pre-commit run --all-files
ruff
:
stage
:
quality
image
:
python:3.12
script
:
-
pip install ruff
-
ruff check --output-format=gitlab src/cigas_ptrms tests > gl-code-quality-report.json
artifacts
:
reports
:
codequality
:
gl-code-quality-report.json
mypy
:
stage
:
quality
image
:
python:3.12
script
:
-
pip install .[dev]
-
mypy src/cigas_ptrms tests
allow_failure
:
true
test
:
stage
:
test
image
:
python:$PYTHON_VERSION
needs
:
[
"
pre-commit"
,
"
ruff"
]
script
:
-
pip install -e .[dev]
-
pytest
coverage
:
'
/\d+\%\s*$/'
artifacts
:
when
:
always
reports
:
junit
:
coverage.xml
parallel
:
matrix
:
-
PYTHON_VERSION
:
[
"
3.11"
,
"
3.12"
]
deploy
:
stage
:
release
image
:
python:3.12
needs
:
[
"
test"
]
script
:
-
pip install build twine
-
python -m build
-
TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
only
:
-
tags
artifacts
:
paths
:
-
dist
when
:
on_success
expire_in
:
"
1
week"
prepare_release
:
stage
:
release
image
:
python:3.12
needs
:
-
deploy
rules
:
-
if
:
'
$CI_COMMIT_TAG
=~
/^?\d+\.\d+\.\d+$/'
script
:
-
pip install generate-changelog
-
generate-changelog -o notes -t $CI_COMMIT_TAG > release_notes.md
artifacts
:
paths
:
-
release_notes.md
release_job
:
stage
:
release
image
:
registry.gitlab.com/gitlab-org/release-cli:latest
needs
:
-
job
:
prepare_release
artifacts
:
true
rules
:
-
if
:
'
$CI_COMMIT_TAG
=~
/^?\d+\.\d+\.\d+$/'
before_script
:
-
"
"
script
:
-
echo "Creating release"
release
:
name
:
"
Release
$CI_COMMIT_TAG"
description
:
release_notes.md
tag_name
:
"
$CI_COMMIT_TAG"
ref
:
"
$CI_COMMIT_SHA"
pages
:
stage
:
docs
image
:
python:3.12
needs
:
[
"
test"
]
script
:
-
pip install .[docs]
-
cd docs
-
make html
-
mv build/html ../public
artifacts
:
paths
:
-
public
only
:
-
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