Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WSL2 workflow for setup tests #280

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: pwsh
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
Loading