|
7 | 7 |
|
8 | 8 | variables: |
9 | 9 | NodeVersion: "14.x" |
10 | | - AutorestTestFolder: "$(Build.SourcesDirectory)/packages/autorest.python/test/" |
| 10 | + TestFolder: "$(Build.SourcesDirectory)/packages/autorest.python/test/" |
| 11 | + AUTOREST_TESTSERVER_COVERAGE_DIRECTORY: "$(Build.SourcesDirectory)/packages/autorest.python/coverage/" |
11 | 12 |
|
12 | 13 | steps: |
13 | | - - script: npm install -g pnpm |
14 | | - displayName: Install PNPM |
| 14 | + - task: NodeTool@0 |
| 15 | + displayName: "Install Node.js $(NodeVersion)" |
| 16 | + inputs: |
| 17 | + versionSpec: "$(NodeVersion)" |
15 | 18 |
|
16 | | - - script: pnpm install |
17 | | - displayName: Install dependencies |
| 19 | + - task: UsePythonVersion@0 |
| 20 | + displayName: "Use Python 3.7" |
| 21 | + inputs: |
| 22 | + versionSpec: 3.7 |
18 | 23 |
|
19 | | - - script: pnpm run build |
20 | | - displayName: Build |
| 24 | + - script: | |
| 25 | + npm install -g pnpm |
| 26 | + npm install -g autorest |
| 27 | + pnpm install |
| 28 | + pip install -r dev_requirements.txt |
| 29 | + displayName: "Prepare Environment for Generation" |
| 30 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
| 31 | +
|
| 32 | + - script: | |
| 33 | + pylint autorest |
| 34 | + displayName: "Pylint" |
| 35 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
| 36 | +
|
| 37 | + - script: | |
| 38 | + mypy autorest |
| 39 | + displayName: "Mypy" |
| 40 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
| 41 | +
|
| 42 | + - script: | |
| 43 | + pytest test/unittests |
| 44 | + displayName: "Unit tests" |
| 45 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
21 | 46 |
|
22 | | - - script: pip install -r packages/autorest.python/dev_requirements.txt |
23 | | - displayName: Install Autorest Python dev requirements |
| 47 | + - script: | |
| 48 | + pip install tox coverage==4.5.4 |
| 49 | + displayName: "Install Env Specific Reqs in Target PyVersion $(PythonVersion)" |
24 | 50 |
|
25 | | - - script: pip install -r packages/cadl-python/dev_requirements.txt |
26 | | - displayName: Install Cadl dev requirements |
| 51 | + - script: | |
| 52 | + cd $(TestFolder)/azure/legacy |
| 53 | + tox -e ci |
| 54 | + displayName: 'Execute legacy "azure" Tests - Python $(PythonVersion)' |
| 55 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
27 | 56 |
|
28 | 57 | - script: | |
29 | | - cd $(AutorestTestFolder)/azure/version-tolerant |
| 58 | + cd $(TestFolder)/azure/version-tolerant |
30 | 59 | tox -e ci |
31 | | - displayName: Execute Autorest Azure Version Tolerant Tests |
| 60 | + displayName: 'Execute version tolerant "azure" Tests - Python $(PythonVersion)' |
32 | 61 | workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
33 | 62 |
|
34 | 63 | - script: | |
35 | | - cd $(AutorestTestFolder)/vanilla/version-tolerant |
| 64 | + cd $(TestFolder)/vanilla/legacy |
36 | 65 | tox -e ci |
37 | | - displayName: Execute Autorest Vanilla Version Tolerant Tests |
| 66 | + displayName: 'Execute legacy "vanilla" Tests - Python $(PythonVersion)' |
38 | 67 | workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
39 | 68 |
|
40 | 69 | - script: | |
41 | | - cd $(AutorestTestFolder)/dpg/version-tolerant |
| 70 | + cd $(TestFolder)/vanilla/version-tolerant |
42 | 71 | tox -e ci |
43 | | - displayName: Execute Autorest DPG Version Tolerant Tests |
| 72 | + displayName: 'Execute version tolerant "vanilla" Tests - Python $(PythonVersion)' |
44 | 73 | workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
45 | 74 |
|
46 | 75 | - script: | |
47 | | - cd test/mock_api_tests |
| 76 | + cd $(TestFolder)/dpg/version-tolerant |
48 | 77 | tox -e ci |
49 | | - displayName: Execute Cadl Tests |
50 | | - workingDirectory: $(Build.SourcesDirectory)/packages/cadl-python/ |
| 78 | + displayName: 'Execute version tolerant "dpg" Tests - Python $(PythonVersion)' |
| 79 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
51 | 80 |
|
52 | 81 | - script: | |
53 | | - pnpm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token) |
54 | | - NPM_AUTH_TOKEN="$(azure-sdk-npm-token)" pnpm -r publish --access public --no-git-checks |
55 | | - displayName: Publish packages |
| 82 | + export RELEASE_VERSION=$(node -p -e "require('./package.json').version") |
| 83 | + npm pack |
| 84 | + npx publish-release --token $(azuresdk-github-pat) --repo autorest.python --owner azure --name "Autorest for Python v$RELEASE_VERSION" --tag v$RELEASE_VERSION --notes='Release version of Autorest for Python v5' --prerelease --editRelease false --assets autorest-python-$RELEASE_VERSION.tgz --target_commitish $(Build.SourceBranchName) |
| 85 | + displayName: "Publish GitHub release" |
| 86 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
| 87 | +
|
| 88 | + - script: | |
| 89 | + echo "//registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)" > ./.npmrc |
| 90 | + npm publish --access public |
| 91 | + displayName: "Publish to npm" |
| 92 | + workingDirectory: $(Build.SourcesDirectory)/packages/autorest.python/ |
0 commit comments