Skip to content

Commit

Permalink
Azure pipeline support for arm64 using qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
odidev committed Aug 17, 2020
1 parent d4d5f82 commit 61cd26b
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .azure-pipelines/azure_aarch64_script/test_steps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
echo "exporting Mutlidict root directory"
export MULTIDICT_ROOT=$(cd "$(dirname "$0")/.."; pwd;)

echo "Installing build dependencies"
yum install gcc gcc-c++ python3-devel wget make enchant-devel -y

cd $MULTIDICT_ROOT
export PATH='/opt/bin':${PATH}
echo "standard path for different python versions"
export PYTHON="/opt/_internal/cpython-$1*/bin/python"

echo "Update pip"
$PYTHON -m pip install --upgrade pip setuptools wheel
if [ $? != "0" ]; then
echo "Update pip failed"
exit 1
fi

echo "Install itself"
$PYTHON setup.py install
if [ $? != "0" ]; then
echo "Install itself failed"
exit 1
fi

echo "Install dependencies"
$PYTHON -m pip install -r requirements/pytest.txt
if [ $? != "0" ]; then
echo "Install dependencies failed"
exit 1
fi

echo "Install pytest-azurepipelines"
$PYTHON -m pip install pytest-azurepipelines
if [ $? != "0" ]; then
echo "Install pytest-azurepipelines failed"
exit 1
fi

echo "pytest"
$PYTHON -m pytest tests -vv
if [ $? != "0" ]; then
echo "pytest failed"
exit 1
fi

echo "Prepare coverage"
$PYTHON -m coverage xml
if [ $? != "0" ]; then
echo "Prepare coverage failed"
exit 1
fi

if [ CODECOV_TOKEN != '' ]; then
echo "Install codecov"
$PYTHON -m pip install codecov
if [ $? != "0" ]; then
echo "Install codecov failed"
exit 1
fi
echo "Upload coverage reports"
$PYTHON -m codecov -f coverage.xml -X gcov
if [ $? != "0" ]; then
echo "Upload coverage reports failed"
exit 1
fi
else
echo "code coverage upload is not intended"
fi
echo "test complete"
1 change: 1 addition & 0 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ variables:
stages:
- template: stage-lint.yml
- template: stage-test.yml
- template: stage-aarch64.yml
52 changes: 52 additions & 0 deletions .azure-pipelines/stage-aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
stages:
- stage: azure_linux_test
displayName: 'azure-aarch64'

jobs:
- job: 'arm64'
strategy:
matrix:
Py35-C-Linux:
python.version: '3.5'
no_extensions: ''
image: 'ubuntu-latest'
Py36-C-Linux:
python.version: '3.6'
no_extensions: ''
image: 'ubuntu-latest'
Py37-C-Linux:
python.version: '3.7'
no_extensions: ''
image: 'ubuntu-latest'
Py38-C-Linux:
python.version: '3.8'
no_extensions: ''
image: 'ubuntu-latest'
pool:
vmImage: 'ubuntu-latest'

steps:
- checkout: self
submodules: true
clean: true

- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: docker run --rm --privileged hypriot/qemu-register
displayName: 'Regietering qemu'
- script: |
export DOCKER_IMAGE=quay.io/pypa/manylinux2014_aarch64
set -xeo pipefail
export MULTIDICT_ROOT=`pwd`
export HOST_USER_ID=$(id -u)
docker run -v "${MULTIDICT_ROOT}":/home/multidict_root:rw,z \
-e HOST_USER_ID \
-e CODECOV_TOKEN \
$DOCKER_IMAGE \
bash /home/multidict_root/.azure-pipelines/azure_aarch64_script/test_steps.sh "$(python.version)"
displayName: 'Running AArch64 build'
env:
CODECOV_TOKEN: $(codecov.token)

0 comments on commit 61cd26b

Please sign in to comment.