Skip to content

Commit

Permalink
Pr workflow migration changes (#1429)
Browse files Browse the repository at this point in the history
* Pr workflow migration changes

* Run Test fron old Release job enabled false

* added if condition to make job disable
  • Loading branch information
v-soujanya authored Dec 23, 2024
1 parent 8eb5144 commit 9d99013
Show file tree
Hide file tree
Showing 12 changed files with 434 additions and 14 deletions.
20 changes: 20 additions & 0 deletions .github/actions/build-publish-azure-cli-test-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

name: 'Build and Publish Azure CLI Test SDK'
description: 'Build and publish the Azure CLI Test SDK'
runs:
using: 'composite'
steps:
- run: rm -rf azure-cli
shell: bash
- run: git clone https://github.com/Azure/azure-cli.git
shell: bash
- run: pip install --upgrade .
shell: bash
working-directory: azure-cli/src/azure-cli-testsdk/
- run: python setup.py sdist bdist_wheel
shell: bash
working-directory: azure-cli/src/azure-cli-testsdk/
- uses: actions/upload-artifact@v4
with:
name: azure-cli-test-sdk
path: azure-cli/src/azure-cli-testsdk/dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

name: 'Build and Publish Azure DevOps CLI Extension'
description: 'Build and publish the Azure DevOps CLI extension'
runs:
using: 'composite'
steps:
- run: pip install --upgrade .
shell: bash
working-directory: azure-devops/
- run: python scripts/removeComments.py
shell: bash
- run: python setup.py sdist bdist_wheel
shell: bash
working-directory: azure-devops/
- uses: actions/upload-artifact@v4
with:
name: azure-devops-cli-extension
path: azure-devops/dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

name: 'Download and Install Local Azure DevOps CLI Extension with pip'
description: 'Download and install the local Azure DevOps CLI extension using pip'
runs:
using: 'composite'
steps:
- uses: actions/download-artifact@v4
with:
name: azure-devops-cli-extension
path: ${{ github.workspace }}/extension
- run: |
$extensionUninstall = az extension remove -n azure-devops
$extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($extension in $extensions)
{
Write-Host "installing " $extension.FullName
pip install $extension.FullName
}
Write-Host "done"
shell: pwsh
working-directory: ${{ github.workspace }}/extension
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

name: 'Download and Install Local Azure DevOps CLI Extension'
description: 'Download and install the local Azure DevOps CLI extension'
runs:
using: 'composite'
steps:
- uses: actions/download-artifact@v4
with:
name: azure-devops-cli-extension
path: ${{ github.workspace }}/extension
- run: |
$extensionUninstall = az extension remove -n azure-devops
$extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($extension in $extensions)
{
Write-Host "installing " $extension.FullName
az extension add --source $extension.FullName -y --debug
}
Write-Host "done"
shell: pwsh
working-directory: ${{ github.workspace }}/extension
20 changes: 20 additions & 0 deletions .github/actions/download-install-local-azure-test-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

name: 'Download and Install Local Azure Test SDK'
description: 'Download and install the local Azure Test SDK'
runs:
using: 'composite'
steps:
- uses: actions/download-artifact@v4
with:
name: azure-cli-test-sdk
path: ${{ github.workspace }}/wheels
- run: |
$wheels = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName
Foreach ($wheel in $wheels)
{
Write-Host "installing" $wheel.FullName
pip install $wheel.FullName
}
Write-Host "done"
shell: pwsh
working-directory: ${{ github.workspace }}/wheels
20 changes: 20 additions & 0 deletions .github/actions/install-azure-cli-edge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

name: 'Install Azure CLI Edge'
description: 'Install the Azure CLI Edge version'
runs:
using: 'composite'
steps:
- run: python -m pip install --upgrade pip
shell: bash
- run: python --version
shell: bash
- run: az --version
shell: bash
- run: pip uninstall azure-cli -y
shell: bash
- run: pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --upgrade-strategy eager
shell: bash
- run: python --version
shell: bash
- run: az --version
shell: bash
8 changes: 8 additions & 0 deletions .github/actions/install-azure-cli-released/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

name: 'Install Azure CLI released'
description: 'Install Azure CLI released version'
runs:
using: 'composite'
steps:
- run: pip install azure-cli
shell: bash
36 changes: 36 additions & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

name: 'Run Tests'
description: 'Run tests with specified Python version'
inputs:
python-version:
description: 'Python version to use'
required: true
run-only-recorded-tests:
description: 'Run only recorded tests'
required: false
default: 'false'
run-with-azure-cli-released:
description: 'Run with Azure CLI released version'
required: false
default: 'false'
runs:
using: 'composite'
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
architecture: x64
- if: ${{ inputs.run-with-azure-cli-released == 'false' }}
uses: ./.github/actions/install-azure-cli-edge
- if: ${{ inputs.run-with-azure-cli-released == 'true' }}
uses: ./.github/actions/install-azure-cli-released
- uses: ./.github/actions/download-install-local-azure-test-sdk
- uses: ./.github/actions/setup-ci-machine
- uses: ./.github/actions/download-install-local-azure-devops-cli-extension
- run: pytest --junitxml "TEST-results.xml"
if: ${{ inputs.run-only-recorded-tests == 'false' }}
shell: bash
working-directory: azure-devops
- run: pytest tests --junitxml "TEST-results.xml"
if: ${{ inputs.run-only-recorded-tests == 'true' }}
shell: bash
16 changes: 16 additions & 0 deletions .github/actions/setup-ci-machine/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

name: 'Setup CI Machine'
description: 'Setup the CI machine with necessary dependencies'
runs:
using: 'composite'
steps:
- run: python -m pip install --upgrade pip
shell: bash
- run: pip install wheel==0.30.0 setuptools==70.0.0
shell: bash
- run: pip install pytest==6.2.5
shell: bash
- run: pip install coverage
shell: bash
- run: pip install pytest-cov
shell: bash
Loading

0 comments on commit 9d99013

Please sign in to comment.