Commit a7cce5b6 authored by Baptiste CHOCOT's avatar Baptiste CHOCOT
Browse files

add cache key; update install step; add test for dev branches only; update baseline test

parent e6ec26c4
Pipeline #222782 failed with stages
in 41 seconds
...@@ -4,32 +4,55 @@ variables: ...@@ -4,32 +4,55 @@ variables:
SCORER_CONDA_ENV: "$CONDA_ENVS/scorer.env" SCORER_CONDA_ENV: "$CONDA_ENVS/scorer.env"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip"
default: default:
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- "$PIP_CACHE_DIR"
- "$CONDA_ENVS"
image: continuumio/anaconda3 image: continuumio/anaconda3
cache:
paths:
- "$PIP_CACHE_DIR"
- "$CLI_CONDA_ENV"
stages: stages:
- setup - setup
- merge-test
- test - test
- simulation - simulation
# Install CLI and dependencies
install: install:
stage: setup stage: setup
only:
- pushes
script: script:
- python3 -m pip install pycodestyle - python3 -m pip install pycodestyle
- export PATH=$PATH:~/.local/bin
#- if [[ -f requirements.txt ]]; then python3 -m pip install -r requirements.txt; python3 -m pip install -e .; fi #- if [[ -f requirements.txt ]]; then python3 -m pip install -r requirements.txt; python3 -m pip install -e .; fi
#- if [[ -f environment.yml ]]; then mkdir $CONDA_ENVS; conda create -f environment.yml -p $CLI_CONDA_ENV; fi #- if [[ -f environment.yml ]]; then mkdir $CONDA_ENVS; conda create -f environment.yml -p $CONDA_ENVS; fi
- bash diva_evaluation_cli/bin/install.sh --all -c $CLI_CONDA_ENV -s $SCORER_CONDA_ENV - if [[ -f environment.yml ]]; then args="-c $CLI_CONDA_ENV -s $SCORER_CONDA_ENV"; fi
- bash diva_evaluation_cli/bin/install --all $args
# If a dev* branch, merging it on dev then master
test-merge:
stage: merge-test
needs: [install]
only:
- pushes
- refs
- /^dev.*/
script:
- if [[ "$CI_COMMIT_BRANCH" -ne "development" ]]; then git checkout development && git merge $CI_COMMIT_BRANCH; fi
- git checkout master && git merge development
test-code: test-code:
stage: test stage: test
needs: [install] needs: [install, test-merge]
only:
- pushes
script: script:
- python3 -m pycodestyle --filename=*.py diva_evaluation_cli/bin/ test/ - python3 -m pycodestyle --filename=*.py diva_evaluation_cli/bin/ test/
- python3 -m unittest discover -s test/ - python3 -m unittest discover -s test/
- if [[ -f environment.yml ]]; then conda activate $CLI_CONDA_ENV; fi - if [[ -f environment.yml ]]; then conda activate $CLI_CONDA_ENV; fi
- actev -h - actev -h
- actev validate-system --strict
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment