Skip to content

Commit

Permalink
add Azure Pipelines (#868)
Browse files Browse the repository at this point in the history
Add Azure Pipelines
  • Loading branch information
vtbassmatt authored and pganssle committed Feb 22, 2019
1 parent 03d9683 commit 8cb0e19
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
80 changes: 80 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
pool:
vmImage: $[ variables.POOL_IMAGE ]

strategy:
matrix:
Python27:
python.version: '2.7'
Python34:
python.version: '3.4'
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Docs:
python.version: '3.6'
TOXENV: docs
TZ:
python.version: '3.6'
TOXENV: tz
macOS:
python.version: '3.6'
POOL_IMAGE: macos-10.13
Windows:
python.version: '3.6'
POOL_IMAGE: vs2017-win2016
installzic: 'windows'
PyPy:
PYTHON: 'pypy'
PyPy3:
PYTHON: 'pypy3'

variables:
TOXENV: py
POOL_IMAGE: ubuntu-16.04
PYTHON: 'python'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
condition: notIn(variables.PYTHON, 'pypy', 'pypy3')

- bash: |
PYPYDIR=$(dirname $(dirname $(readlink -f $(which $PYTHON))))
sudo chmod a+rwX -R $PYPYDIR
$PYTHON -m ensurepip
displayName: Ensure pip
condition: in(variables.PYTHON, 'pypy', 'pypy3')

- bash: |
$PYTHON -m pip install -U six && $PYTHON -m pip install -U tox
if [[ $PYTHON_VERSION == "3.3" ]]; then pip install 'virtualenv<16.0'; fi
if [[ $PYTHON_VERSION == "3.3" ]]; then pip install 'setuptools<40.0'; fi
displayName: Ensure prereqs

- bash: |
curl https://get.enterprisedb.com/postgresql/postgresql-9.4.20-1-windows-x64-binaries.zip --output postgresql.zip
unzip -oq postgresql.zip -d postgresql
echo $PATH
echo "##vso[task.prependpath]$(System.DefaultWorkingDirectory)\postgresql\pgsql\bin"
displayName: Install zic on Windows
condition: eq(variables.installzic, 'windows')

- bash: |
if [[ $TOXENV == "py" ]]; then
./ci_tools/retry.sh $PYTHON updatezinfo.py
$PYTHON -m tox -- dateutil/test --cov-config=tox.ini --cov=dateutil --junitxml=unittests/TEST-$(Agent.JobName).xml
$PYTHON -m tox -e coverage,codecov
else
$PYTHON -m tox
fi
displayName: Run tox

- task: PublishTestResults@2
inputs:
testResultsFiles: '**/TEST-*.xml'
testRunTitle: '$(Agent.JobName)'
condition: and(succeededOrFailed(), not(eq(variables['Agent.JobName'], 'Docs')))
6 changes: 5 additions & 1 deletion ci_tools/run_tz_master_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ TMP_TARBALL=${TMP_DIR}/dateutil-zoneinfo.tar.gz

UPSTREAM_URL="https://github.com/eggert/tz.git"

if [ -n "$TF_BUILD" ]; then
EXTRA_TEST_ARGS=--junitxml=../unittests/TEST-tz.xml
fi

function cleanup {
# Since this script modifies the original repo, whether or not
# it fails we need to restore the original file so as to not
Expand Down Expand Up @@ -89,5 +93,5 @@ ${CITOOLS_DIR}/make_zonefile_metadata.py \
python ${REPO_DIR}/updatezinfo.py $ZONEFILE_METADATA_NAME

# Run the tests
python -m pytest ${REPO_DIR}/dateutil/test
python -m pytest ${REPO_DIR}/dateutil/test $EXTRA_TEST_ARGS

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ skip_missing_interpreters = true
[testenv]
description = run the unit tests with pytest under {basepython}
setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname}
passenv = DATEUTIL_MAY_CHANGE_TZ TOXENV CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_*
passenv = DATEUTIL_MAY_CHANGE_TZ TOXENV CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_* SYSTEM_* AGENT_* BUILD_* TF_BUILD
commands = python -m pytest {posargs: "{toxinidir}/dateutil/test" --cov-config="{toxinidir}/tox.ini" --cov=dateutil}
deps = -rrequirements-dev.txt

Expand Down

0 comments on commit 8cb0e19

Please sign in to comment.