-
-
Notifications
You must be signed in to change notification settings - Fork 8
75 lines (65 loc) · 2.88 KB
/
pr-windows-script-replacer-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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"
}