Newer
Older
# This file is a template, and might need editing before it works on your project.
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
#
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
stages: # List of stages for jobs, and their order of execution
- build
- test
# build-ngsolve-job: # This job runs in the build stage, which runs first.
# stage: build
# image: python:3.10
# before_script:
# # virtual python3 env
# # - apt update && apt install python3.10-venv
# - apt-get update -q -y
# - apt-get install -y python3-pip
# - python -V
# - pip3 install ngsolve
# - apt-get install -y cmake
# cache:
# key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
# paths:
# - ./C++/cmake/build/*
# - ./usr/*
# artifacts:
# untracked: true
# when: on_success
# expire_in: "30 days"
# paths:
# - ./C++/cmake/build/cempy.so
# script:
# - echo "Compiling the code for ngSolve..."
# - cd ./C++/cmake
# - mkdir build
# - cd build
# - cmake .. -DOPTION_BIOTSAVART=OFF -DOPTION_BSPLINEINTERFACESPACE=OFF -DOPTION_PREISACH_SCALAR=OFF -DOPTION_PREISACH_VECTOR=OFF -DOPTION_ENERGYBASEDMODEL=OFF -DOPTION_MARKUSLIB=OFF -DOPTION_MULTISCALE=OFF -DOPTION_MUNONLINBIRO=OFF -DOPTION_NONLINEAR=OFF -DOPTION_PHIFUNCTIONS=OFF
# - make -j4
# - python3 -c "from ngsolve import *;import cempy as cp"
# - python3 -c "from ngsolve import *;import cempy as cp"
# build-ngsolve-job: # This job runs in the build stage, which runs first.
# stage: build
# image: python:3.10
# before_script:
# # virtual python3 env
# # - apt update && apt install python3.10-venv
# - apt-get update -q -y
# - apt-get install -y python3-pip
# - python -V
# - pip3 install ngsolve
# script:
# - echo "Compiling the code for ngSolve..."
# - ls
# - pwd
# - ls python
# - export PYTHONPATH=./python
# - echo $PYTHONPATH
# - python3 -c "import compileCppModule;cp = compileCppModule.compileCppModule();print(cp.__dir__.keys())"
build-ngsolve-job: # This job runs in the build stage, which runs first.
stage: build
image: python:3.10
script:
- apt-get update -q -y
- apt-get -y install python3 python3-distutils python3-tk libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev liblapacke-dev libocct-data-exchange-dev libocct-draw-dev occt-misc libtbb-dev libxi-dev
- export BASEDIR=~/ngsuite
- mkdir -p $BASEDIR
- cd $BASEDIR && git clone https://github.com/NGSolve/ngsolve.git ngsolve-src
- cd $BASEDIR/ngsolve-src && git submodule update --init --recursive
- mkdir $BASEDIR/ngsolve-build
- mkdir $BASEDIR/ngsolve-install
- cd $BASEDIR/ngsolve-build
- cmake -DCMAKE_INSTALL_PREFIX=${BASEDIR}/ngsolve-install ${BASEDIR}/ngsolve-src
- make -j4
- ls
- ls $BASEDIR
# - echo "export NETGENDIR=${BASEDIR}/ngsolve-install/bin" >> ~/.bashrc
# - echo "export PATH=\$NETGENDIR:\$PATH" >> ~/.bashrc
# - export PYTHONPATH_TMP=`python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1,0,''))"`
# - echo "export PYTHONPATH=\$NETGENDIR/../${PYTHONPATH_TMP}:\$PATH" >> ~/.bashrc
# - source ~/.bashrc
artifacts:
untracked: true
when: on_success
expire_in: "1 month"
paths:
- /usr/local/lib/python3.10/site-packages/ngsolve
build-basicTypes-job: # This job runs in the build stage, which runs first.
before_script:
- apt update && apt -y install make
- echo "Compiling the code for basicTypes..."
- cd ./C++/basicTypes
when: on_success
expire_in: "1 days"
paths:
build-unitTestEverett-job: # This job runs in the build stage, which runs first.
stage: build
before_script:
- apt update && apt -y install make
script:
- echo "Compiling the code for EverettMatrix..."
- make unitTestEverett
- echo "Compile unitTestEverett complete."
when: on_success
expire_in: "1 days"
paths:
build-unitTestPreisachScalar-job: # This job runs in the build stage, which runs first.
stage: build
before_script:
- apt update && apt -y install make
script:
- echo "Compiling the code for PreisachScalar..."
- cd ./C++/preisach/preisachScalar/
- make unitTest
- echo "Compile unitTest complete."
when: on_success
expire_in: "1 days"
paths:
# ---------------------------------------------------------------
# unit-tests-ngsolve-job:
# stage: test
# image: python:3.10
# before_script:
# # virtual python3 env
# # - apt update && apt install python3.10-venv
# - apt-get update -q -y
# - apt-get install -y python3-pip
# - python -V
# - pip3 install ngsolve
# cache:
# key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
# script:
# - echo "Running Unit Testcode for ngSolve..."
# - export PATH=$PATH:~/usr/local/lib/cmake/netgen
# - export PYTHONPATH=~/C++/cmake/build
# - echo $PYTHONPATH
# - ls $PYTHONPATH
# - cd ./unitTests
# - python3 ./dataClassUnit.py
unit-test-basicTypes-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
unit-test-EverettUnitTest-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
dependencies:
- build-unitTestEverett-job
- echo "Running unit tests Everett Matrix."
- make runUnitTestEverett
unit-test-PreisachScalarUnitTest-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
dependencies:
- build-unitTestPreisachScalar-job
script:
- echo "Running unit tests PreisachScalar."
- cd ./C++/preisach/preisachScalar
- make runUnitTest
unit-test-python3-MS_helper_function:
stage: test # It only starts when the job in the build stage completes successfully.
before_script:
- apt-get update -q -y
- apt-get install -y python3-pip
- python -V
- pip3 install ngsolve
- export PYTHONPATH=/builds/valentin.hanser/ngmultiscale/python:/builds/valentin.hanser/ngmultiscale/python/MeshGenerators
script:
- echo "Running python3 unit tests MS_helper_function."
- python3 unitTest_MS_helper_Functions.py
# deploy-job: # This job runs in the deploy stage.
# stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
# environment: production
# script:
# - echo "Deploying application..."
# - echo "Application successfully deployed."