Skip to content

Commit

Permalink
Merge pull request #7074 from mook-as/ci/bats/wsl-no-endpoint
Browse files Browse the repository at this point in the history
CI: BATS: Fix installing WSL distribution
  • Loading branch information
jandubois authored Jun 19, 2024
2 parents f1221c5 + 191831c commit 37bd955
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 2 additions & 5 deletions .github/actions/setup-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ runs:
do {
wsl --update
} while ( -not $? )
- name: "Windows: Finish setting up WSL"
if: runner.os == 'Windows'
shell: pwsh
run: wsl --set-default-version 2
# Setting the default version also lets WSL finish updating.
wsl --set-default-version 2
- name: "Linux: Enable KVM access"
if: runner.os == 'Linux'
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/bats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,18 @@ jobs:

- name: "Windows: Install WSL2 Distribution"
if: runner.os == 'Windows'
shell: pwsh
shell: powershell # pwsh doesn't have Add-AppxPackage
run: |
# Install Debian, but do not launch it
wsl --install Debian --no-launch
# `wsl --install` seems to have issues in CI since 2024-06-14; however,
# manually downloading the Debian installer and running it works.
Invoke-WebRequest https://github.com/microsoft/WSL/raw/master/distributions/DistributionInfo.json |
Select-Object -ExpandProperty Content |
ConvertFrom-JSON |
Select-Object -ExpandProperty Distributions |
Where-Object Name -EQ "Debian" |
Select-Object -ExpandProperty Amd64PackageUrl |
% { Invoke-WebRequest $_ -OutFile Debian.AppxBundle }
Add-AppxPackage Debian.AppxBundle
# Initialize Debian, without going through any first-time setup
debian.exe install --root
Expand Down

0 comments on commit 37bd955

Please sign in to comment.