-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af91fd9
commit f1f061e
Showing
1 changed file
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
name: QA on Azure | ||
# QA checks on Azure, allowing the use of a real WSL back-en | ||
|
||
concurrency: azure-vm | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
az_name: wsl-ci-3 | ||
az_resource_group: wsl | ||
|
||
jobs: | ||
vm-setup: | ||
name: Set up Azure VM | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Azure login | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_VM_CREDS }} | ||
- name: Start the Runner | ||
shell: bash | ||
run: | | ||
az vm start --name ${{ env.az_name }} --resource-group ${{ env.az_resource_group }} | ||
qa: | ||
name: Run end-to-end tests on the Azure VM | ||
runs-on: [self-hosted, Windows] | ||
needs: vm-setup | ||
steps: | ||
- name: Set up git | ||
uses: canonical/ubuntu-pro-for-windows/.github/actions/setup-git@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Ubuntu | ||
uses: Ubuntu/WSL/.github/actions/wsl-install@main | ||
with: | ||
distro: "Ubuntu" | ||
- name: Set up Go | ||
# actions/setup-go is broken | ||
shell: powershell | ||
run: | | ||
winget install GoLang.Go | ||
Exit(0) | ||
- name: Download Appx | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: qa.yaml | ||
workflow_conclusion: success | ||
name: UbuntuProForWindows+.* | ||
name_is_regexp: true | ||
path: ci-artifacts | ||
- name: Download Wsl-Pro-Service | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: qa.yaml | ||
workflow_conclusion: success | ||
name: wsl-pro-service_.* | ||
name_is_regexp: true | ||
path: ci-artifacts | ||
- name: Set up artifacts | ||
shell: powershell | ||
working-directory: ci-artifacts | ||
run: | | ||
Write-Output "::group::Set up AppxPackage" | ||
Get-AppxPackage -Name "CanonicalGroupLimited.UbuntuProForWindows" | Remove-AppxPackage -ErrorAction Ignore | ||
New-Item -Name "windows-agent" -ItemType Directory | ||
Move-Item -Path "UbuntuProForWindows+*/UbuntuProForWindows_*/*.msixbundle" -Destination "windows-agent/" | ||
Move-Item -Path "UbuntuProForWindows+*/UbuntuProForWindows_*/*.cer" -Destination "windows-agent/" | ||
Remove-Item -Recurse "UbuntuProForWindows+*/" | ||
$cert = "$(Get-ChildItem windows-agent/UbuntuProForWindows_*.cer)" | ||
Import-Certificate -FilePath "${cert}" -CertStoreLocation Cert:LocalMachine\TrustedPeople | ||
Write-Output "::endgroup::" | ||
Write-Output "::group::Set up WSL Pro Service" | ||
New-Item -Name "wsl-pro-service" -ItemType Directory | ||
Move-Item -Path "wsl-pro-service_*/wsl-pro-service_*.deb" -Destination "wsl-pro-service/" | ||
Remove-Item -Recurse "wsl-pro-service_*/" | ||
Write-Output "::endgroup::" | ||
- name: Test | ||
shell: powershell | ||
env: | ||
GIT_TERMINAL_PROMPT: "0" | ||
UP4W_TEST_OVERRIDE_DESTRUCTIVE_CHECKS: "1" | ||
UP4W_TEST_BUILD_PATH: "../ci-artifacts" | ||
UP4W_TEST_PRO_TOKEN: "${{ secrets.UBUNTU_PRO_TOKEN }}" | ||
run: | | ||
go env -w "GOPRIVATE=github.com/${{ github.repository }}" | ||
go test .\end-to-end -shuffle=on -timeout 20m | ||
if ( "$LastExitCode" -ne "0" ) { Exit(1) } | ||
- name: Clean up | ||
if: always() | ||
shell: powershell | ||
run: | | ||
# Clean up artifacts | ||
# Remove .gitconfig so that the github URL overrides do not stack | ||
Remove-Item -Recurse -Path "${HOME}\.gitconfig" -ErrorAction Ignore | ||
# Uninstall Appx | ||
Get-AppxPackage -Name "CanonicalGroupLimited.UbuntuProForWindows" | Remove-AppxPackage -ErrorAction Ignore | ||
stop-vm: | ||
name: Clean up the Azure VM | ||
runs-on: ubuntu-latest | ||
needs: [vm-setup, qa] | ||
if: always() | ||
steps: | ||
- name: Azure login | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_VM_CREDS }} | ||
- name: Deallocate the Runner | ||
shell: bash | ||
run: | | ||
az vm deallocate --name ${{ env.az_name }} --resource-group ${{ env.az_resource_group }} |