Azure: Run Lint task as separate job

Lint task uses PyPI to get the latest Pylint, which may pull in
any other packages as dependencies. For distro isolation the Lint
job should not produce any meaningful artifacts or they should not
be used in subsequent jobs. So, this job have to be isolated from
the others.

Fixes: https://pagure.io/freeipa/issue/8772
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Stanislav Levin authored and Alexander Bokovoy committed 2021-03-30 13:18:09 +03:00
1 parent 2bec09aa03
commit 188a279c5b
5 files changed
+26

No files matched your search

+2
View File
@@ -257,6 +257,7 @@ endif
$(PYTHON) -m pycodestyle --diff || exit $$?; \
echo -e "\npylint"; \
echo "------"; \
$(PYTHON) -m pylint --version; \
PYTHONPATH=$(abspath $(top_srcdir)) $(PYTHON) -m pylint \
--rcfile=$(top_srcdir)/pylintrc \
--load-plugins pylint_plugins \
@@ -365,6 +366,7 @@ pylint: $(GENERATED_PYTHON_FILES) ipasetup.py python_scripts
-type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \
FILES=`echo -e "$${FILES}\n$(AZURE_PYTHON_SCRIPT_SUBDIR)"`; \
echo -e "Pylint on $(PYTHON) is running over files:\n$${FILES}\nPlease wait ...\n"; \
$(PYTHON) -m pylint --version; \
PYTHONPATH=$(top_srcdir) $(PYTHON) -m pylint \
--rcfile=$(top_srcdir)/pylintrc \
--load-plugins pylint_plugins \
+11
View File
@@ -66,12 +66,23 @@ jobs:
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.PREPARE_LINT_TEMPLATE }}
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
- script: |
set -e
echo "Running make target 'lint'"
make V=0 lint
displayName: Lint sources
- job: Docs
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
- template: templates/${{ variables.BUILD_DOCS_TEMPLATE }}
- template: templates/publish-build.yml
parameters:
@@ -0,0 +1,7 @@
steps:
- script: |
set -e
sudo dnf -y install python3-pip
# https://pagure.io/freeipa/issue/8771
python3 -m pip install --user --upgrade astroid pylint==2.7.1
displayName: Install Lint dependencies
@@ -17,6 +17,9 @@ variables:
PREPARE_TOX_TEMPLATE: ${{ format('prepare-tox-{0}.yml', variables.IPA_PLATFORM) }}
PREPARE_WEBUI_TEMPLATE: ${{ format('prepare-webui-{0}.yml', variables.IPA_PLATFORM) }}
# the template to install Lint dependencies
PREPARE_LINT_TEMPLATE: ${{ format('prepare-lint-{0}.yml', variables.IPA_PLATFORM) }}
# the template to build sphinx docs
BUILD_DOCS_TEMPLATE: ${{ format('build-docs-{0}.yml', variables.IPA_PLATFORM) }}
@@ -20,6 +20,9 @@ variables:
PREPARE_TOX_TEMPLATE: ${{ format('prepare-tox-{0}.yml', variables.IPA_PLATFORM) }}
PREPARE_WEBUI_TEMPLATE: ${{ format('prepare-webui-{0}.yml', variables.IPA_PLATFORM) }}
# the template to install Lint dependencies
PREPARE_LINT_TEMPLATE: ${{ format('prepare-lint-{0}.yml', variables.IPA_PLATFORM) }}
# the template to build sphinx docs
BUILD_DOCS_TEMPLATE: ${{ format('build-docs-{0}.yml', variables.IPA_PLATFORM) }}