Skip to content

Commit

Permalink
Add WSL2 workflow for setup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeledy committed Nov 27, 2024
1 parent 4f445f8 commit e460105
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/pr-setup-wsl-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Setup WSL Tests

on:
pull_request:
workflow_dispatch:

jobs:
leia-tests:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
leia-test:
- setup-linux
node-version:
- "20"
os:
- windows-2022
defaults:
run:
shell: wsl bash --noprofile --norc -euo pipefail "$(script="$(wslpath '{0}')" && sed -i 's/\r$//' "$script" && echo "$script")"
steps:
- name: Install Ubuntu in WSL2
shell: powershell
run: |
# Manually download and install Ubuntu to avoid the reboot that kills the Actions runner
Set-Service -Name StorSvc -StartupType Automatic
wsl.exe --set-default-version 2
wsl.exe --update
$distributionInfo = Invoke-RestMethod -Uri 'https://raw.githubusercontent.com/microsoft/WSL/refs/heads/master/distributions/DistributionInfo.json'
$downloadUrl = $distributionInfo.Distributions.Where({ $_.Name -eq 'Ubuntu' }).Amd64PackageUrl
$filename = [System.IO.Path]::GetFileName($downloadUrl)
Write-Output 'Installing Ubuntu...'
Set-Location $env:TEMP
Invoke-WebRequest -Uri $downloadUrl -OutFile $filename
Expand-Archive -Path $filename -DestinationPath .\
.\ubuntu.exe install --root
- name: Checkout code
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Bundle Deps
uses: lando/prepare-release-action@v3
with:
lando-plugin: true
version: dev
sync: false
- name: Install pkg dependencies
run: npm clean-install --prefer-offline --frozen-lockfile --production
- name: Package into node binary
uses: lando/pkg-action@v5
id: pkg-action
with:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
options: --options dns-result-order=ipv4first
upload: false
pkg: "@yao-pkg/[email protected]"
- name: Install full deps
run: npm clean-install --prefer-offline --frozen-lockfile
- name: Setup lando ${{ steps.pkg-action.outputs.file }}
uses: lando/setup-lando@v3
with:
auto-setup: false
lando-version: ${{ steps.pkg-action.outputs.file }}
telemetry: false
- name: Run Leia Tests
run: |
npx leia "examples/${{ matrix.leia-test }}/README.md" -c 'Destroy tests' --stdin --debug
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Added a WSL2 workflow for the `setup` tests

## v3.23.13 - [November 23, 2024](https://github.com/lando/core/releases/tag/v3.23.13)

* Fixed bug causing metrics opt-out to not work in some situations [#277](https://github.com/lando/core/issues/277)
Expand Down

0 comments on commit e460105

Please sign in to comment.