Skip to content
Snippets Groups Projects
Commit 324ab029 authored by Stefan Possanner's avatar Stefan Possanner
Browse files

use before_script in ci

parent 2e8054c3
Branches
Tags
1 merge request!16Add stages to ci
Pipeline #172164 passed
...@@ -8,9 +8,21 @@ default: ...@@ -8,9 +8,21 @@ default:
# Try to use only one job per stage. # Try to use only one job per stage.
# Stupid GitLab fails to load the cache for second jobs. # Stupid GitLab fails to load the cache for second jobs.
cache: # Global `cache`. cache: # Global `cache`.
key: 'python-env'
paths: paths:
- g2p-env-$CI_PIPELINE_ID/ - g2p-env-$CI_PIPELINE_ID/
before_script:
- apt-get -qq update && apt-get -qq install -y gcc gfortran libblas-dev liblapack-dev
- source g2p-env-$CI_PIPELINE_ID/bin/activate
- pip list
- ENV_PATH=$(python3 -c "import sysconfig; print(sysconfig.get_path('platlib'))")
#- ENV_PATH=$(python3 -m site --user-site)
- LIBDIR=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
- echo $ENV_PATH
- echo $LIBDIR
- ls
artifacts: artifacts:
reports: reports:
coverage_report: coverage_report:
...@@ -18,7 +30,7 @@ default: ...@@ -18,7 +30,7 @@ default:
path: coverage.xml path: coverage.xml
paths: paths:
- logs/execution.log - logs/execution.log
- dist/* - dist/
after_script: # Global `after_script`. after_script: # Global `after_script`.
- ls g2p-env-$CI_PIPELINE_ID - ls g2p-env-$CI_PIPELINE_ID
...@@ -47,7 +59,6 @@ default_venv: ...@@ -47,7 +59,6 @@ default_venv:
- uname -o - uname -o
- echo "Hello ${GITLAB_USER_NAME} !" - echo "Hello ${GITLAB_USER_NAME} !"
- echo "This is job ${CI_JOB_ID}" - echo "This is job ${CI_JOB_ID}"
- apt-get -qq update && apt-get -qq install -y gcc gfortran libblas-dev liblapack-dev
script: script:
- echo "Creating virtual environment..." - echo "Creating virtual environment..."
- pip install -U virtualenv - pip install -U virtualenv
...@@ -68,11 +79,7 @@ default_build: ...@@ -68,11 +79,7 @@ default_build:
- if: $CI_PIPELINE_SOURCE == "push" - if: $CI_PIPELINE_SOURCE == "push"
needs: ['default_venv'] needs: ['default_venv']
script: script:
- pip list
- python3 -m build # build gvec_to_python (.whl) - python3 -m build # build gvec_to_python (.whl)
artifacts:
paths:
- dist/
install_and_test: install_and_test:
stage: install_and_test stage: install_and_test
...@@ -81,12 +88,6 @@ install_and_test: ...@@ -81,12 +88,6 @@ install_and_test:
when: never when: never
- if: $CI_COMMIT_REF_PROTECTED == "false" && $CI_PIPELINE_SOURCE == "push" - if: $CI_COMMIT_REF_PROTECTED == "false" && $CI_PIPELINE_SOURCE == "push"
needs: ['default_build'] needs: ['default_build']
before_script: # Overrides global `before_script`.
- echo "Hello, $GITLAB_USER_LOGIN!"
- python -V # Print out python version for debugging.
- pwd
- apt-get -qq update && apt-get -qq install -y gcc gfortran libblas-dev liblapack-dev
- source g2p-env-$CI_PIPELINE_ID/bin/activate
script: script:
# install package # install package
- ls -lah dist - ls -lah dist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment