From 70fb84846ba68ba7c4fa4a61dadba10c569844a6 Mon Sep 17 00:00:00 2001 From: Renken Date: Sat, 2 Apr 2022 15:24:17 +0200 Subject: [PATCH] gitlab-ci: use debian image --- .gitlab-ci.yml | 95 ++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f01720b..23c193c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,5 @@ +image: debian + stages: - analyse - test @@ -6,74 +8,75 @@ stages: variables: GIT_SUBMODULE_STRATEGY: normal +cache: + paths: + - .venv/ + +before_script: + - apt-get update + - apt-get dist-upgrade -y + - > + apt-get install --no-install-recommends -y + bash + build-essential + cmake + coreutils + findutils + git + grep + make + plantuml + python3 + python3-pip + python3-venv + rsync + sed + # Convenient hack until this is fixed. + - ln -s /usr/bin/python3 /usr/bin/python + +.setup_build: &setup_build + - python -m venv .venv + - . ./.venv/bin/activate + - python -m pip install -r requirements.txt + - mkdir build + - cd build + line_limit: stage: analyse + needs: [] allow_failure: true - image: registry.git.mel.vin/vermim/cicd/cicd/coreutils:0.1 script: - - mkdir build - - cd build + - *setup_build - cmake -DDOC:STRING=OFF -DLINE_LIMIT:BOOL=ON -DWERROR:BOOL=ON .. - make line_limit regex_check: stage: analyse + needs: [] allow_failure: true - image: registry.git.mel.vin/vermim/cicd/cicd/coreutils:0.1 script: - - mkdir build - - cd build + - *setup_build - cmake -DDOC:STRING=OFF -DREGEX_CHECK:BOOL=ON -DWERROR:BOOL=ON .. - make regex_check sphinx_html: stage: test - image: registry.git.mel.vin/vermim/cicd/cicd/sphinx_html:0.3 + needs: [] script: - - mkdir build - - cd build - - cmake -DWERROR:BOOL=ON .. + - *setup_build + - cmake -DDOC:STRING=html .. - make artifacts: paths: - build/doc/html -review: +pages: stage: deploy - variables: - GIT_STRATEGY: none - only: - - master@shione/shione - dependencies: - - sphinx_html - image: registry.git.mel.vin/vermim/cicd/cicd/coreutils:0.1 - environment: - name: review/$CI_COMMIT_REF_NAME - url: https://shione.vermwa.re - on_stop: review_stop + rules: + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + needs: ["sphinx_html"] script: - - mkdir -p ~/.ssh - - echo "$DOC_SSH_KNOWNHOSTS" > ~/.ssh/known_hosts - - eval $(ssh-agent) - - echo "$DOC_SSH_KEY" | ssh-add - > /dev/null - mv build/doc/html public - - rsync -a --delete public/ 'web@shione.vermwa.re:' - -review_stop: - stage: deploy - variables: - GIT_STRATEGY: none - when: manual - dependencies: [] - image: registry.git.mel.vin/vermim/cicd/cicd/coreutils:0.1 - environment: - name: review/$CI_COMMIT_REF_NAME - action: stop - script: - - mkdir -p ~/.ssh - - echo "$DOC_SSH_KNOWNHOSTS" > ~/.ssh/known_hosts - - eval $(ssh-agent) - - echo "$DOC_SSH_KEY" | ssh-add - > /dev/null - - mkdir /tmp/empty - - rsync -a --delete /tmp/empty/ 'web@shione.vermwa.re:' - - rmdir /tmp/empty + artifacts: + paths: + - public