variables: DOCKER_IMAGE: registry.forge.hefr.ch/klagarge/mse2425-grp09/python-pdm:latest default: image: $DOCKER_IMAGE stages: - lint - test test job: stage: test script: - cd src - cp -r /app/__pypackages__ . # Set environment variables for the tests - export FLASK_SECRET_KEY=$FLASK_SECRET_KEY # launch tests - export PYTHONPATH="/builds/Klagarge/mse2425-grp09/src:/builds/Klagarge/mse2425-grp09/src/__pypackages__/3.9/lib" - export PATH="/builds/Klagarge/mse2425-grp09/src/__pypackages__/3.9/bin:$PATH" - export FLASK_APP=app - pdm run pytest tests --cov --cov-report term --cov-report html artifacts: paths: - src/htmlcov/ lint job: stage: lint dependencies: [] script: - python3 -m pip install flake8 - flake8 src/ allow_failure: true # Linter can fail, fixing it is for now outside of the projects scope pages: stage: test dependencies: - test job needs: ["test job"] script: - mv src/htmlcov/ public/ artifacts: paths: - public expire_in: 7 days only: - main