diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8de713324b94a82152df3a6f1888186bc9e39dbe..9de54d13982efd54dde224b20f26664feefd06ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,16 @@ -# 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. +# This file is based a sample GitLab CI/CD configuration file that demonstrates a basic 3 stage CI/CD pipeline. +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml +# Python-specific template is located at +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml # # 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 -# Python-specific template is located at -# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml # Official language image. Look for the different tagged releases at: # https://hub.docker.com/r/library/python/tags/ @@ -57,14 +51,13 @@ build-job: # This job runs in the build stage, which runs first. - build/* unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. + stage: test script: - echo "Running unit tests..." - pip install pytest - pip install pytest-cov - pip install -e . - pytest --junitxml=report.xml - #- python -m pytest # tests/ artifacts: paths: - report.xml @@ -76,31 +69,42 @@ unit-test-job: # This job runs in the test stage. - tests/**/* when: always +# Build the pages +# All necessary files need to be moved or build in the 'public' folder pages: stage: deploy script: + # Do all installations - apt update - apt-get -y install graphviz - pip install -U sphinx m2r2 furo pyUML pydot==2.0.0 gprof2dot - pip install graphviz - #- pip install graphviz==2.50.0 - pip install -e . + # Generate the new directories - mkdir public - cd public - mkdir diagrams - - cd ../ + - mkdir examples + - cd examples + - mkdir user_guide + - cd ../../ + # Copy and build the diagrams - cp docs/diagrams/* public/diagrams - #- cp docs/diagrams/class_diagram.py public/diagrams - cd public/diagrams - python class_diagram.py - cd ../../ + # Copy and build the needed examples + - cp examples/user_guide/* public/examples/user_guide + - cd public/examples/user_guide + - python example_user_guide.py + - cd ../../../ + # Build the html-pages - sphinx-build -b html docs/source public - #- mv docs/diagrams ./public artifacts: paths: - public - #only: - #- master + only: + - master deploy-job: # This job runs in the deploy stage.