Skip to content

Commit

Permalink
Merge branch 'mr/boris/add-ci' into 'master'
Browse files Browse the repository at this point in the history
Add a CI

See merge request it/e3-testsuite!28
  • Loading branch information
pmderodat committed May 23, 2024
2 parents c06b501 + 5e63e3f commit 5aca052
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
66 changes: 66 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
variables:
GITLAB_REMOTE: "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/"

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
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ passenv = APPVEYOR* , TRAVIS , TRAVIS_* , CI

# Run testsuite with coverage when '-cov' is in the env name
commands=
pytest --ignore=build -v \
pytest --ignore=build -vv --junit-xml=pytest-report.xml \
ci: --ci \
cov: --e3-cov-rewrite {envsitepackagesdir} src \
cov: --cov e3.testsuite \
Expand Down

0 comments on commit 5aca052

Please sign in to comment.