Skip to content

Commit

Permalink
Merge branch 'mr/boris/ci-templates' into 'master'
Browse files Browse the repository at this point in the history
Use templates within CI config

See merge request it/e3-testsuite!29
  • Loading branch information
yakobowski committed Jul 30, 2024
2 parents 04f4862 + 884c93a commit 4193a52
Showing 1 changed file with 6 additions and 62 deletions.
68 changes: 6 additions & 62 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,10 @@
variables:
GITLAB_REMOTE: "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/"
include:
- component: $CI_SERVER_FQDN/eng/gitlab-templates/pre-commit@~latest
- component: $CI_SERVER_FQDN/eng/gitlab-templates/tox@~latest
inputs:
tox-section: py311-cov
stage: test

stages:
- check
- test

workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'

.tox:
variables:
PYTHON_VERSION: py311
interruptible: true
services:
- image:all-pythons
before_script:
- git config --global --add
url."${GITLAB_REMOTE}/it/black.git".insteadOf
https://github.com/ambv/black
- git config --global --add
url."${GITLAB_REMOTE}/it/flake8.git".insteadOf
https://github.com/pycqa/flake8
- git config --global --add
url."${GITLAB_REMOTE}/it/pre-commit-mypy.git".insteadOf
https://github.com/pre-commit/mirrors-mypy
- source /it/activate-${PYTHON_VERSION}
- python -m pip install --force tox

## Deactivated, as eng-bot has not rights under it/
# issue-check:
# stage: check
# interruptible: true
# services:
# - image:e3
# variables:
# GIT_STRATEGY: none
# script:
# - require_issue

check:
extends: .tox
stage: check
script:
- python -m pip install pre-commit
- pre-commit install --install-hooks
- pre-commit run -a --show-diff-on-failure
- python -m tox --colored yes -e checkstyle

test-py-common:
extends: .tox
needs: []
stage: test
script:
- python -m tox --colored yes -e ${PYTHON_VERSION}-cov
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
paths:
- pytest-report.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: pytest-report.xml

0 comments on commit 4193a52

Please sign in to comment.