From 13612c8ffac704cf5c22fa5c735895d72941a846 Mon Sep 17 00:00:00 2001 From: Valentin Emiya <23557104+valentin-emiya@users.noreply.github.com> Date: Sun, 14 Jul 2024 21:21:51 +0200 Subject: [PATCH] ci.yml: mv lines to before_script section --- .gitlab-ci.yml | 104 ++++++++++--------------------------------------- 1 file changed, 21 insertions(+), 83 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e230e5..2ce97c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,19 +4,10 @@ default: cache: # Pip's cache doesn't store the python packages paths: # https://pip.pypa.io/en/stable/topics/caching/ - .cache/pip - before_script: + - vendor/ + - .apt/ -stages: - - test -# Change pip's cache directory to be inside the project directory since we can -# only cache local items. -variables: - PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - -install_and_test_39: - image: python:3.9 - stage: test - script: + before_script: - apt-get update - apt-get install -y --no-install-recommends cmake - apt-get install -y --no-install-recommends gcc @@ -24,22 +15,17 @@ install_and_test_39: - apt-get install -y --no-install-recommends make - apt-get install -y --no-install-recommends libfftw3-dev - apt-get install -y --no-install-recommends liblapack-dev - - apt-get install -y --no-install-recommends python3 - - apt-get install -y --no-install-recommends python3-dev - - apt-get install -y --no-install-recommends python3-setuptools - - apt-get install -y --no-install-recommends python3-pytest - - apt-get install -y --no-install-recommends python3-pytest-cov - - apt-get install -y --no-install-recommends python3-coverage - apt-get install -y --no-install-recommends libjs-jquery-hotkeys - apt-get install -y --no-install-recommends libjs-jquery-isonscreen - apt-get install -y --no-install-recommends libjs-jquery-tablesorter + - apt-get install -y --no-install-recommends texlive-latex-extra + - apt-get install -y --no-install-recommends dvipng + - apt-get install -y --no-install-recommends python3 + - apt-get install -y --no-install-recommends python3-dev + - apt-get install -y --no-install-recommends python3-setuptools - apt-get install -y --no-install-recommends python3-pip - apt-get install -y --no-install-recommends python3-wheel - apt-get install -y --no-install-recommends python3-tk - - apt-get install -y --no-install-recommends python3-matplotlib - - apt-get install -y --no-install-recommends python3-scipy - - apt-get install -y --no-install-recommends texlive-latex-extra - - apt-get install -y --no-install-recommends dvipng - apt-get clean - pip install virtualenv - virtualenv venv @@ -47,6 +33,18 @@ install_and_test_39: - pip install --upgrade pip - pip install matplotlib numpy scipy six coverage pytest pytest-cov - dpkg -L python3-pytest | xargs file | grep executable + +stages: + - test +# Change pip's cache directory to be inside the project directory since we can +# only cache local items. +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + +install_and_test_39: + image: python:3.9 + stage: test + script: - pip3 install -e . --no-deps - python3 -m pytest artifacts: @@ -60,36 +58,6 @@ install_and_test_310: image: python:3.10 stage: test script: - - apt-get update - - apt-get install -y --no-install-recommends cmake - - apt-get install -y --no-install-recommends gcc - - apt-get install -y --no-install-recommends g++ - - apt-get install -y --no-install-recommends make - - apt-get install -y --no-install-recommends libfftw3-dev - - apt-get install -y --no-install-recommends liblapack-dev - - apt-get install -y --no-install-recommends python3 - - apt-get install -y --no-install-recommends python3-dev - - apt-get install -y --no-install-recommends python3-setuptools - - apt-get install -y --no-install-recommends python3-pytest - - apt-get install -y --no-install-recommends python3-pytest-cov - - apt-get install -y --no-install-recommends python3-coverage - - apt-get install -y --no-install-recommends libjs-jquery-hotkeys - - apt-get install -y --no-install-recommends libjs-jquery-isonscreen - - apt-get install -y --no-install-recommends libjs-jquery-tablesorter - - apt-get install -y --no-install-recommends python3-pip - - apt-get install -y --no-install-recommends python3-wheel - - apt-get install -y --no-install-recommends python3-tk - - apt-get install -y --no-install-recommends python3-matplotlib - - apt-get install -y --no-install-recommends python3-scipy - - apt-get install -y --no-install-recommends texlive-latex-extra - - apt-get install -y --no-install-recommends dvipng - - apt-get clean - - pip install virtualenv - - virtualenv venv - - source venv/bin/activate - - pip install --upgrade pip - - pip install matplotlib numpy scipy six coverage pytest pytest-cov - - dpkg -L python3-pytest | xargs file | grep executable - pip3 install -e . --no-deps - python3 -m pytest artifacts: @@ -103,36 +71,6 @@ install_and_test_311: image: python:3.11 stage: test script: - - apt-get update - - apt-get install -y --no-install-recommends cmake - - apt-get install -y --no-install-recommends gcc - - apt-get install -y --no-install-recommends g++ - - apt-get install -y --no-install-recommends make - - apt-get install -y --no-install-recommends libfftw3-dev - - apt-get install -y --no-install-recommends liblapack-dev - - apt-get install -y --no-install-recommends python3 - - apt-get install -y --no-install-recommends python3-dev - - apt-get install -y --no-install-recommends python3-setuptools - - apt-get install -y --no-install-recommends python3-pytest - - apt-get install -y --no-install-recommends python3-pytest-cov - - apt-get install -y --no-install-recommends python3-coverage - - apt-get install -y --no-install-recommends libjs-jquery-hotkeys - - apt-get install -y --no-install-recommends libjs-jquery-isonscreen - - apt-get install -y --no-install-recommends libjs-jquery-tablesorter - - apt-get install -y --no-install-recommends python3-pip - - apt-get install -y --no-install-recommends python3-wheel - - apt-get install -y --no-install-recommends python3-tk - - apt-get install -y --no-install-recommends python3-matplotlib - - apt-get install -y --no-install-recommends python3-scipy - - apt-get install -y --no-install-recommends texlive-latex-extra - - apt-get install -y --no-install-recommends dvipng - - apt-get clean - - pip install virtualenv - - virtualenv venv - - source venv/bin/activate - - pip install --upgrade pip - - pip install matplotlib numpy scipy six coverage pytest pytest-cov - - dpkg -L python3-pytest | xargs file | grep executable - pip3 install -e . --no-deps - python3 -m pytest artifacts: @@ -167,7 +105,7 @@ ubuntu:i686: script: - conda create -n py39 Python=3.9 - conda activate py39 - - pip3 install -e . --no-deps + - pip3 install -e . --no-depsgit - python3 -m pytest artifacts: when: always -- GitLab