seminaire-ci/.gitlab-ci.yml

50 lines
1.2 KiB
YAML

stages:
- linting
- test
- compile_slides
flake8:
stage: linting
image: python:3-alpine
before_script:
- pip install flake8 --no-cache-dir
script: flake8 main.py main_test.py
allow_failure: true
pylint:
stage: linting
image: python:3-alpine
before_script:
- pip install pylint --no-cache-dir
script: pylint main.py main_test.py
allow_failure: true
test:
stage: test
image: python:3-alpine
before_script:
- pip install pytest pytest-cov --no-cache-dir
script: pytest --showlocals --cov=main --cov=main_test --cov-report=term-missing .
slides:
stage: compile_slides
image: aergus/latex
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 0700 ~/.ssh
- ssh-keyscan ynerant.fr >> ~/.ssh/known_hosts
- chmod 0644 ~/.ssh/known_hosts
script:
- latexmk -cd -pdf slides/seminaire-ci.tex
- scp slides/seminaire-ci.pdf gitlab-ci@ynerant.fr:gitlab-ftp/seminaire-ci.pdf
artifacts:
paths:
- slides/seminaire-ci.pdf
expire_in: 1 mo