variables: RSYNC_OPTS: --recursive --ignore-missing-args --chown ${DEPLOY_USER}:${DEPLOY_USER} DOCKER_TAG: ${CI_COMMIT_REF_NAME} DOCKER_TAG_DEV: ${CI_COMMIT_REF_NAME} DOCKER_IMAGE: rwthacs/dpsim DOCKER_IMAGE_DEV: rwthacs/dpsim-dev before_script: - git config --local core.longpaths true - git submodule sync --recursive - git submodule update --init --recursive stages: - prepare - build - test - generate - deploy #- post-all docker: stage: prepare script: - docker build --file Packaging/Docker/Dockerfile.dev --tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} --tag ${DOCKER_IMAGE_DEV}:latest . # build dedicated jupyter image in the future # - docker build # --file Packaging/Docker/Dockerfile.jupyter # --build-arg DOCKER_IMAGE=${DOCKER_IMAGE_DEV} # --build-arg DOCKER_TAG=${DOCKER_TAG_DEV} # --tag ${DOCKER_IMAGE_DEV}-jupyter:${DOCKER_TAG_DEV} # --tag ${DOCKER_IMAGE_DEV}-jupyter:latest . tags: - shell - linux build:linux: stage: build script: - mkdir -p build - cd build - cmake .. - make -j 32 image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} cache: paths: - build key: build-linux artifacts: paths: - build tags: - docker build:windows: stage: build script: - New-Item -ItemType Directory -Force -Path build - Set-Location -Path build # 64 Bit Graphviz Builds for Windows: # https://ci.appveyor.com/project/ellson/graphviz-pl238/ - cmake .. -DGraphviz_ROOT="C:/Program Files/Graphviz 2.41.20190716.1839" - cmake --build . -j 24 tags: - win10 cache: paths: - build key: build-win10 build:macos: stage: build script: - mkdir -p build - cd build - cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9 -DWITH_CIM_SUBMODULE=ON -DWITH_SUNDIALS=OFF .. - make -j $(sysctl -n hw.ncpu) cache: paths: - build key: build-macos artifacts: paths: - build tags: - mac test:pytest: stage: test variables: PYTHONPATH: "build/Source/Python:Source/Python" script: - pytest -v Examples/CIM/test_CIM.yml - pytest -v Examples/Cxx/test_Circuits.yml - pytest -v Examples/Cxx/test_RealTime.yml #- pytest -v Examples/Cxx/test_Shmem.yml - pytest -v Examples/Python/Base - pytest -v Examples/Python/Circuits - pytest -v Examples/Python/RealTime #- pytest -v Examples/Python/Shmem image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} dependencies: - build:linux tags: - docker generate:docs: stage: generate script: - make -j$(nproc) -C build docs - make -j$(nproc) -C build docs_cxx image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} dependencies: - build:linux artifacts: paths: - build/Documentation/html - build/Documentation/Cxx/html tags: - docker generate:packages: stage: generate script: - make -j$(nproc) -C build package only: - tags tags: - docker image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} dependencies: - build:linux artifacts: paths: - build/*.rpm - build/*.tar.gz build:docker: stage: build script: - docker build --file Packaging/Docker/Dockerfile --build-arg DOCKER_TAG=${DOCKER_TAG} --build-arg CI=1 --build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --build-arg CI_COMMIT_TAG=${CI_COMMIT_TAG} --tag ${DOCKER_IMAGE}:${DOCKER_TAG} --tag ${DOCKER_IMAGE}:latest . tags: - shell - linux only: - tags test:jupyter: stage: test variables: PYTHONPATH: "build/Source/Python:Source/Python" script: - pytest -v Examples/Notebooks image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} dependencies: - build:linux tags: - docker artifacts: paths: - outputs/Examples/Notebooks/ deploy:docker: stage: deploy script: - docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} - docker push ${DOCKER_IMAGE_DEV}:latest - docker push ${DOCKER_IMAGE}:${DOCKER_TAG} - docker push ${DOCKER_IMAGE}:latest dependencies: - build:docker tags: - shell - linux only: - tags deploy:docs: stage: deploy script: - ssh ${DEPLOY_USER}@${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/{sphinx,doxygen} - rsync ${RSYNC_OPTS} --delete build/Documentation/html/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/sphinx - rsync ${RSYNC_OPTS} --delete build/Documentation/Cxx/html/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/doxygen dependencies: - generate:docs only: - tags - deploy tags: - fein-deploy - shell - linux deploy:packages: stage: deploy script: - rsync ${RSYNC_OPTS} build/*.rpm ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/packages/fedora/29/x86_64 - rsync ${RSYNC_OPTS} build/*.tar.gz ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/dpsim/src - ssh ${DEPLOY_USER}@${DEPLOY_HOST} createrepo /var/www/packages/fedora/29 dependencies: - generate:packages only: - tags tags: - fein-deploy - shell - linux # We run the windows build at last as it takes ages to finish #build:windows: # stage: post-all # script: # - rmdir build /s # - mkdir build # - cd build # - cmake -G "Visual Studio 15 2017 Win64" .. # - cmake --build . # tags: # - windows