Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gvec_to_python
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gvec-group
gvec_to_python
Commits
2e8054c3
Commit
2e8054c3
authored
2 years ago
by
Stefan Possanner
Browse files
Options
Downloads
Patches
Plain Diff
add stages to ci
parent
8c495a03
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!16
Add stages to ci
Pipeline
#172158
failed
2 years ago
Stage: startup
Stage: build
Stage: install_and_test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+48
-26
48 additions, 26 deletions
.gitlab-ci.yml
with
48 additions
and
26 deletions
.gitlab-ci.yml
+
48
−
26
View file @
2e8054c3
...
...
@@ -9,7 +9,7 @@ default:
# Stupid GitLab fails to load the cache for second jobs.
cache
:
# Global `cache`.
paths
:
-
g2p-env-$CI_PIPELINE_ID
-
g2p-env-$CI_PIPELINE_ID
/
artifacts
:
reports
:
...
...
@@ -28,31 +28,67 @@ variables:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
stages
:
-
startup
-
build
-
install_and_test
-
release
# Changes (e.g. apt install, pip install) do not persist across different GitLab CI jobs.
# => Consolidate everything in GitLab CI into a single job, because the design is dumb.
# => Since we only have one job, and GitLab Pages requires the job to be called `pages` for it to work, we now call this job `pages`.
# python virtual environment into cache
default_venv
:
stage
:
startup
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
$CI_PIPELINE_SOURCE == "push"
before_script
:
-
uname -s
# get system info
-
uname -v
-
uname -m
-
uname -o
-
echo "Hello ${GITLAB_USER_NAME} !"
-
echo "This is job ${CI_JOB_ID}"
-
apt-get -qq update && apt-get -qq install -y gcc gfortran libblas-dev liblapack-dev
script
:
-
echo "Creating virtual environment..."
-
pip install -U virtualenv
-
python3 -m venv g2p-env-$CI_PIPELINE_ID
-
ls
-
pwd
-
source g2p-env-$CI_PIPELINE_ID/bin/activate
-
python3 -m pip install --upgrade pip
-
pip install -U pip build pytest pytest-cov coverage twine
-
pip list
# build on mpcdf server
default_build
:
stage
:
build
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
$CI_PIPELINE_SOURCE == "push"
needs
:
[
'
default_venv'
]
script
:
-
pip list
-
python3 -m build
# build gvec_to_python (.whl)
artifacts
:
paths
:
-
dist/
install_and_test
:
stage
:
install_and_test
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
$CI_COMMIT_REF_PROTECTED == "false" && $CI_PIPELINE_SOURCE == "push"
needs
:
[
'
default_build'
]
before_script
:
# Overrides global `before_script`.
-
echo "Hello, $GITLAB_USER_LOGIN!"
-
python -V
# Print out python version for debugging.
-
pwd
# Install everything.
-
apt-get -qq update && apt-get -qq install -y gcc gfortran libblas-dev liblapack-dev libopenmpi-dev openmpi-bin
-
python -m venv g2p-env-$CI_PIPELINE_ID
-
apt-get -qq update && apt-get -qq install -y gcc gfortran libblas-dev liblapack-dev
-
source g2p-env-$CI_PIPELINE_ID/bin/activate
-
pip install -U pip build pytest pytest-cov coverage twine
script
:
# Build: build python package, install package.
-
echo "Run python build:"
-
python -m build
# install package
-
ls -lah dist
-
echo "Install dist:"
-
pip install -U dist/gvec_to_python-*.whl --force-reinstall
...
...
@@ -77,7 +113,7 @@ deploy:
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
$CI_COMMIT_REF_NAME == "master"
needs
:
[
"
install_and_test
"
]
needs
:
[
"
default_build
"
]
script
:
-
twine upload dist/*
...
...
@@ -119,18 +155,4 @@ release_job:
url
:
'
https://pypi.org/project/gvec_to_python/'
# OLD, TO BE DELETED
# deploy:
# stage: release
# rules:
# - if: $CI_COMMIT_TAG
# when: never
# - if: $CI_COMMIT_REF_NAME == "master"
# before_script:
# - apt-get -qq update && apt-get -qq install -y gcc gfortran libblas-dev liblapack-dev libopenmpi-dev openmpi-bin
# - pip install -U pip build twine
# script:
# - python -m build
# - ls -lah dist
# - twine upload dist/*
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