freeipa/ipatests/azure/azure-pipelines.yml
Stanislav Levin aa5a3336a8 Azure: Allow distros to install Python they want
The platforms may have different Pythons.
But due to [0] the Python installed via the 'UsePythonVersion@0'
task should be compatible with the container's 'libpythonxx.so'.
'AZURE_PYTHON_VERSION' platform variable is introduced to cover
this. So, if your distro has Python3.8, set the mentioned variable
to '3.8', later, this version will be installed by the
'UsePythonVersion@0' Azure task for 'WebUI_Unit_Tests' and 'Tox'
jobs.

To allow tox to run any Python3 environment the 'py3' one is used.
'py3' is the well-known Tox's environment, which utilizes 'python3'
executable.

[0]: https://github.com/microsoft/azure-pipelines-tasks/issues/11070

Fixes: https://pagure.io/freeipa/issue/8254
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
2020-04-07 15:22:47 -04:00

166 lines
5.4 KiB
YAML

trigger:
- master
variables:
- template: templates/variables-common.yml
# platform specific variables, links to
- template: templates/variables.yml
jobs:
- job: Build
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
set -e
git update-ref refs/heads/$(System.PullRequest.TargetBranch) origin/$(System.PullRequest.TargetBranch)
make V=0 "GIT_BRANCH=$(System.PullRequest.TargetBranch)" fastlint
displayName: Quick code style check
condition: eq(variables['Build.Reason'], 'PullRequest')
- template: templates/${{ variables.BUILD_TEMPLATE }}
- template: templates/publish-build.yml
parameters:
artifactName: 'packages-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)'
targetPath: $(Build.Repository.LocalPath)/dist
displayName: Publish packages
- script: |
set -e
mkdir container
cp -pr dist container/
cp $(IPA_TESTS_DOCKERFILES)/$(DOCKER_DOCKERFILE) container/Dockerfile
cd container
docker build -t freeipa-azure-builder .
docker save freeipa-azure-builder | gzip > '$(builddir)/freeipa-azure-builder-container.tar.gz'
displayName: Create container image for test
- template: templates/publish-build.yml
parameters:
artifactName: 'image-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)'
targetPath: $(Build.Repository.LocalPath)/freeipa-azure-builder-container.tar.gz
displayName: Publish container image
- template: templates/generate-matrix.yml
parameters:
definition: 'ipatests/azure/azure_definitions/gating.yml'
displayName: Generate Matrix for Gating tests
name: gating_matrix
- template: templates/generate-matrix.yml
parameters:
definition: 'ipatests/azure/azure_definitions/base.yml'
displayName: Generate Matrix for Base tests
name: base_matrix
- job: Lint
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
set -e
echo "Running make target 'lint'"
make V=0 lint
echo "Building documentation"
make -C doc/ html SPHINXOPTS="-W"
displayName: Lint sources and documentation
- template: templates/save-test-artifacts.yml
parameters:
logsPath: doc/_build/html
logsArtifact: docs-$(System.JobIdentifier)-$(Build.BuildId)-$(System.StageAttempt)-$(System.PhaseAttempt)-$(System.JobPositionInPhase)
- job: Tox
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ variables.AZURE_PYTHON_VERSION }}
architecture: x64
- template: templates/${{ variables.PREPARE_TOX_TEMPLATE }}
- script: |
set -e
echo "Running tox"
export LANG=en_US.utf8
export LC_CTYPE=en_US.utf8
locale
$(TOX_COMMAND) -e py3,pypi,pylint3
displayName: Tox
- task: PublishTestResults@2
inputs:
testResultsFiles: '.tox/**/junit-*.xml'
testRunTitle: 'Tox results'
condition: succeededOrFailed()
- job: WebUI_Unit_Tests
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ variables.AZURE_PYTHON_VERSION }}
architecture: x64
- template: templates/${{ variables.PREPARE_WEBUI_TEMPLATE }}
- script: |
set -e
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
set -e
echo "Running WebUI unit tests"
cd $(builddir)/install/ui/js/libs && make
cd $(builddir)/install/ui && npm install
cd $(builddir)/install/ui && node_modules/grunt/bin/grunt --verbose test
displayName: WebUI Unit Tests
- task: PublishTestResults@2
inputs:
testResultsFiles: 'install/ui/_build/test-reports/TEST-*.xml'
testRunTitle: 'Web UI unit test results'
condition: succeededOrFailed()
- job: BASE_XMLRPC
pool:
vmImage: $(VM_IMAGE)
dependsOn: Build
condition: succeeded()
strategy:
matrix: $[ dependencies.Build.outputs['base_matrix.matrix'] ]
steps:
- template: templates/generate-job-variables.yml
- template: templates/test-jobs.yml
- job: GATING
pool:
vmImage: $(VM_IMAGE)
dependsOn: Build
condition: succeeded()
strategy:
matrix: $[ dependencies.Build.outputs['gating_matrix.matrix'] ]
timeoutInMinutes: 90
steps:
- template: templates/generate-job-variables.yml
- template: templates/test-jobs.yml