Add test workflow to validate versions-manifest.json file

This commit is contained in:
MaksimZhukov 2020-06-16 18:39:00 +03:00
parent 6e82fdd5b2
commit 94ccfe8b74
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,38 @@
name: Validate 'versions-manifest.json' file
on:
push:
branches:
- master
paths:
- 'versions-manifest.json'
jobs:
setup-versions-from-manifest:
name: Setup ${{ matrix.python }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
python: [3.5.4, 3.6.7, 3.7.5, 3.8.1]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup-python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Validate version
run: |
$pythonVersion = (python --version)
if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
exit 1
}
$pythonVersion
shell: pwsh
- name: Run simple code
run: python -c 'import math; print(math.factorial(5))'

View File

@ -29,6 +29,10 @@ jobs:
-AzureDevOpsProjectName $(System.TeamProject) `
-AzureDevOpsAccessToken $(System.AccessToken) `
-SourceBranch $(Build.SourceBranch) `
-DefinitionId $(DEFINITION_ID) `
-SourceVersion $(Build.SourceVersion) `
-ManifestLink $(MANIFEST_LINK) `
-WaitForBuilds $(WAIT_FOR_BUILDS) `
-ToolVersions "$(PYTHON_VERSIONS)" `
-DefinitionId $(DEFINITION_ID)
-RetryIntervalSec $(RETRY_INTERVAL_SEC) `
-RetryCount $(RETRY_COUNT)