From 77ca9b95352a65fb493d5970afde158296a3202c Mon Sep 17 00:00:00 2001 From: Tim Head Date: Sun, 8 Sep 2019 17:27:09 +0200 Subject: [PATCH] Add more test scenarios to Azure pipeline --- azure-pipelines.yml | 64 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2fac5dad..cced6513 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,11 +1,52 @@ # https://docs.microsoft.com/azure/devops/pipelines/ecosystems/python pool: vmImage: "ubuntu-16.04" +strategy: + matrix: + lint: + REPO_TYPE: 'lint' + python_version: '3.6' + unit: + REPO_TYPE: 'unit' + python_version: '3.6' + base: + REPO_TYPE: 'base' + python_version: '3.6' + conda: + REPO_TYPE: 'conda' + python_version: '3.6' + pipfile: + REPO_TYPE: 'pipfile' + python_version: '3.6' + venv: + REPO_TYPE: 'venv' + python_version: '3.6' + stencila_r: + REPO_TYPE: 'stencila-r' + python_version: '3.6' + stencila_py: + REPO_TYPE: 'stencila-py' + python_version: '3.6' + julia: + REPO_TYPE: 'julia' + python_version: '3.6' + r: + REPO_TYPE: 'r' + python_version: '3.6' + nix: + REPO_TYPE: 'nix' + python_version: '3.6' + dockerfile: + REPO_TYPE: 'dockerfile' + python_version: '3.6' + external: + REPO_TYPE: 'external' + python_version: '3.6' steps: - task: UsePythonVersion@0 inputs: - versionSpec: '3.6' + versionSpec: $(python_version) - script: | git config --global user.email "ci@fake.tld" @@ -19,8 +60,21 @@ steps: displayName: 'Install dev requirements' - script: pip install -e . - displayName: 'Install r2d' + displayName: 'Install repo2docker' -# venv conda -- script: pytest --durations 10 --cov repo2docker -vs tests/unit - displayName: 'Run pytest' +- script: pushd tests; pytest --durations 10 --cov repo2docker -v $(REPO_TYPE); popd + displayName: 'Run tests $(REPO_TYPE)' + +- script: | + # point to auto-lint-fix + if [[ "$REPO_TYPE" == "lint" ]]; then + echo "You can install pre-commit hooks to automatically run formatting" + echo "on each commit with:" + echo " pre-commit install" + echo "or you can run by hand on staged files with" + echo " pre-commit run" + echo "or after-the-fact on already committed files with" + echo " pre-commit run --all-files" + fi + displayName: 'Help to debug linter errors' + condition: failed()