Skip to content
Snippets Groups Projects
Verified Commit a7f646b7 authored by Christian Dreher's avatar Christian Dreher
Browse files

chore: Frist draft for cache-optimized pipelines (cleaned up as well for pylint)

parent de3d4c7d
No related branches found
No related tags found
1 merge request!484Enable apt caching, clean up pylint job
Pipeline #7714 failed
......@@ -5,29 +5,34 @@ stages:
- post-deploy-test
default:
.bootstrap-axii:
cache:
key: general-apt-cache
paths:
- .apt
before_script:
- export LC_ALL=C.UTF-8
- export LANG=C.UTF-8
- apt-get update
# Apt cache configuration.
- rm -rf /var/cache/apt/archives || true
- rm -f /etc/apt/apt.conf.d/docker-clean # Remove docker-clean script to avoid cache deletion.
- mkdir .apt || true
- ln -s "$CI_PROJECT_DIR/.apt" /var/cache/apt/archives
- apt-get install sudo -y
# Bootstrap Axii.
- ./bootstrap.sh --apt --dev --yes
- source scripts/install_axii.sh
pylint:
image: ubuntu:18.04
image: python:3.8-bullseye
stage: lint
before_script:
- export LC_ALL=C.UTF-8
- export LANG=C.UTF-8
- apt-get update
- apt-get install sudo -y
- ./bootstrap.sh --apt --dev --yes
- source .venv/bin/activate
- mkdir -p public/badges public/lint
- echo undefined > public/badges/$CI_JOB_NAME.score
script:
- pip install pylint pylint-pytest pylint-gitlab anybadge
- pylint --exit-zero --output-format=text $(find -type f -name "*.py" ! -path "**/.venv/**") | tee /tmp/pylint.txt
- sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pylint.txt > public/badges/$CI_JOB_NAME.score
- pylint --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter $(find -type f -name "*.py" ! -path "**/.venv/**") > code_climate.json
......@@ -48,7 +53,6 @@ pylint:
markdown-lint:
image: python:3.8-bullseye
stage: lint
before_script: []
script:
- pip install pymarkdownlnt
- pymarkdown --config data/tools/pymarkdownlint.json scan -r docs *.md .gitlab > pymarkdown_report.txt || true
......@@ -62,6 +66,7 @@ markdown-lint:
module-lint:
image: ubuntu:22.04
stage: lint
extends: .bootstrap-axii
script:
- source .venv/bin/activate
- python -m armarx_setup.app.lint_modules > axii_module_quality.json
......@@ -74,6 +79,7 @@ module-lint:
unit-bionic:
image: ubuntu:18.04
stage: test
extends: .bootstrap-axii
script:
- source .venv/bin/activate
- coverage run -m pytest --junitxml=report.xml tests/unit
......@@ -91,6 +97,7 @@ unit-bionic:
unit-jammy:
image: ubuntu:22.04
stage: test
extends: .bootstrap-axii
script:
- source .venv/bin/activate
- coverage run -m pytest --junitxml=report.xml tests/unit
......@@ -108,6 +115,7 @@ unit-jammy:
e2e-bionic:
image: ubuntu:18.04
stage: test
extends: .bootstrap-axii
script:
- source .venv/bin/activate
- pytest --junitxml=report.xml tests/e2e
......@@ -119,6 +127,7 @@ e2e-bionic:
e2e-jammy:
image: ubuntu:22.04
stage: test
extends: .bootstrap-axii
script:
- source .venv/bin/activate
- pytest --junitxml=report.xml tests/e2e
......@@ -132,7 +141,6 @@ docker-bionic-dev:
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
before_script: []
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
......@@ -148,7 +156,6 @@ docker-jammy-dev:
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
before_script: []
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
......@@ -163,7 +170,6 @@ docker-bionic-ci-dev:
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
before_script: []
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
......@@ -179,7 +185,6 @@ docker-jammy-ci-dev:
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
before_script: []
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
......@@ -194,7 +199,6 @@ docker-bionic:
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
before_script: []
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
......@@ -212,7 +216,6 @@ docker-jammy:
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
before_script: []
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
......@@ -238,7 +241,6 @@ pages:
.test-docker-image-common:
# Overwrite the default before_script.
before_script:
- source ~/.bashrc
- source /axii/scripts/install_axii.sh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment