remove lando setup and slim support for lando >=3.24 #68
Workflow file for this run
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
name: Windows Script Replacer Tests | |
on: | |
pull_request: | |
jobs: | |
setup-lando-windows-replacer-test: | |
runs-on: windows-2022 | |
env: | |
LANDO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- old-version: v3.23.1 | |
version: v3.23.11 | |
- old-version: v3.23.1 | |
version: v3.23.10 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add tempbin to PATH | |
shell: powershell | |
run: Write-Output "PATH=$env:USERPROFILE\.lando\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
- name: Get older Lando version ${{ matrix.old-version }} | |
shell: powershell | |
run: | | |
$LandoBin = Join-Path -Path "$env:USERPROFILE" -ChildPath '.lando\bin' | |
New-Item -ItemType Directory -Force -Path "$env:RUNNER_TEMP\bin" | Out-Null | |
New-Item -ItemType Directory -Force -Path $LandoBin | Out-Null | |
$LandoUrl = "https://github.com/lando/core/releases/download/${{ matrix.old-version }}/lando-win-x64-${{ matrix.old-version }}-slim.exe" | |
Invoke-WebRequest -Uri $LandoUrl -OutFile "$env:RUNNER_TEMP\bin\lando.exe" -UseBasicParsing | |
$wrapper = @" | |
@echo off | |
setlocal enableextensions | |
set LANDO_ENTRYPOINT_NAME=lando | |
set LANDO_WRAPPER_SCRIPT=1 | |
"%RUNNER_TEMP%\bin\lando.exe" %* | |
"@ | |
Set-Content -Path "$env:USERPROFILE\.lando\bin\lando.cmd" -Value $wrapper | |
lando plugin-add @lando/core@${{ matrix.old-version }} | |
lando shellenv --add | |
- name: Verify older situation | |
shell: powershell | |
run: | | |
if (-not (Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.cmd" -SimpleMatch)) { | |
throw "Error: lando is not where we expect it!" | |
} | |
if (-not (lando version | Select-String -Pattern "${{ matrix.old-version }}")) { | |
$reported = lando version | |
throw "Error: lando is not the version we expect! expected ${{ matrix.version}} but found $reported" | |
} | |
- name: Replace Lando with setup-script | |
shell: powershell | |
run: .\setup-lando.ps1 -Version ${{ matrix.version }} -NoSetup | |
- name: Verify new situation | |
shell: powershell | |
run: | | |
if (-not (Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.cmd" -SimpleMatch)) { | |
throw "Error: lando is not where we expect it!" | |
} | |
if (-not (lando version | Select-String -Pattern "${{ matrix.version }}")) { | |
$reported = lando version | |
throw "Error: lando is not the version we expect! expected ${{ matrix.version}} but found $reported" | |
} |