Skip to content
Snippets Groups Projects
Commit 81d22c8a authored by Christine Kim's avatar Christine Kim
Browse files

Update pipeline to run tests

parent c1f0b0de
No related branches found
No related tags found
No related merge requests found
image: ubuntu:18.04 image: continuumio/miniconda3:latest
stages: # List of stages for jobs, and their order of execution
- build
- test
variables:
SSPICE_DEBUG : y
clone_github:
stage: deploy
before_script: before_script:
- apt-get update -y && apt-get install openssh-client -y - conda init bash
- apt install git -y - source ~/.bashrc
- eval $(ssh-agent -s)
- echo "$GIT_SSH_PRIVATE_KEY" | openssl base64 -A -d | ssh-add - build-and-ctest: # This job runs in the build stage, which runs first.
- mkdir -p ~/.ssh variables:
- chmod 700 ~/.ssh SSPICE_DEBUG : y
- ssh-keyscan $GIT_LAB_HOST >> ~/.ssh/known_hosts BUILD_TYPE : Release
- chmod 644 ~/.ssh/known_hosts stage: build
- git config --global user.name "krodriguez" tags:
- git config --global user.email "krodriguez@usgs.gov" - dind
- ssh "git@$GIT_LAB_HOST" script:
- ls $CI_PROJECT_DIR
- git config http.sslVerify "false"
- git config --global url."https://github.com/".insteadOf "git@github.com:"
- git config --global url."https://".insteadOf git://
- GIT_SSL_NO_VERIFY=true git submodule update --init --recursive
- touch /etc/pip.conf
- echo -e "[global]\n
trusted-host = pypi.python.org\n
\tpypi.org\n
\tfiles.pythonhosted.org" >> /etc/pip.conf
- cat /etc/pip.conf
- SSL_NO_VERIFY=1 conda env create -f environment.yml --prefix $CI_PROJECT_DIR/env
- conda init bash
- source ~/.bashrc
- conda activate $CI_PROJECT_DIR/env
- SSL_NO_VERIFY=1 conda install make gcc_linux-64 gxx_linux-64 pthread-stubs
- conda info
- conda list
- cmake -E make_directory $CI_PROJECT_DIR/build
- cmake -E make_directory $CI_PROJECT_DIR/install
- cd $CI_PROJECT_DIR/build/
- cmake $CI_PROJECT_DIR -DCSpice_DIR=$CONDA_PREFIX/lib/cmake/cspice/ -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSPICEQL_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/install
- cmake --build .
- cmake --install .
- echo "Running unit tests... This will take about 60 seconds."
- cd $CI_PROJECT_DIR/build/
- ctest -VV -C $BUILD_TYPE
artifacts:
paths:
- $CI_PROJECT_DIR/build
- $CI_PROJECT_DIR/install
check-install-binaries: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel).
tags:
- dind
dependencies:
- build-and-ctest
script:
- cd $CI_PROJECT_DIR/install/
- test -e lib/libSpiceQL.so
- test -e include/SpiceQL/spiceql.h
check-installed-json-files:
stage: test
tags:
- dind
dependencies:
- build-and-ctest
script: script:
- echo $SOURCE_REPOSITORY - cd $CI_PROJECT_DIR/install
- git config --global http.sslVerify false - pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org jsonschema
- rm -rf spiceql # Needed to allow multiple CI runs - cd $CI_PROJECT_DIR/SpiceQL/db
- git config --global user.name "krodriguez" - |
- git config --global user.email "krodriguez@usgs.gov" for file in *.json;
- git clone --mirror https://github.com/DOI-USGS/SpiceQL.git spiceql do
- cd spiceql pwd
- git remote remove origin jsonschema --instance "$file" schema/spiceMissionSchmea.schema.json
- git remote add origin $DESTINATION_REPOSITORY done;
- git push -f --prune --all
- git push -f --prune --tags
only: # clone_github:
- branches # stage: deploy
# image: ubuntu:18.04
# before_script:
# - apt-get update -y && apt-get install openssh-client -y
# - apt install git -y
# - eval $(ssh-agent -s)
# - echo "$GIT_SSH_PRIVATE_KEY" | openssl base64 -A -d | ssh-add -
# - mkdir -p ~/.ssh
# - chmod 700 ~/.ssh
# - ssh-keyscan $GIT_LAB_HOST >> ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts
# - git config --global user.name "krodriguez"
# - git config --global user.email "krodriguez@usgs.gov"
# - ssh "git@$GIT_LAB_HOST"
# script:
# - echo $SOURCE_REPOSITORY
# - git config --global http.sslVerify false
# - rm -rf spiceql # Needed to allow multiple CI runs
# - git config --global user.name "krodriguez"
# - git config --global user.email "krodriguez@usgs.gov"
# - git clone --mirror https://github.com/DOI-USGS/SpiceQL.git spiceql
# - cd spiceql
# - git remote remove origin
# - git remote add origin $DESTINATION_REPOSITORY
# - git push -f --prune --all
# - git push -f --prune --tags
# only:
# - branches
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment