-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-test-migrate-ruby-windows-uru.yml
More file actions
131 lines (111 loc) · 4.39 KB
/
integration-test-migrate-ruby-windows-uru.yml
File metadata and controls
131 lines (111 loc) · 4.39 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Integration Tests - Migrate Ruby from uru (Windows)
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
migrate:
name: Ruby from uru (Windows)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
- name: Build dtvem
shell: bash
run: |
go build -v -ldflags="-s -w" -o dist/dtvem.exe ./src
go build -v -ldflags="-s -w" -o dist/dtvem-shim.exe ./src/cmd/shim
- name: Initialize dtvem
shell: bash
run: ./dist/dtvem.exe init --yes
- name: Add dtvem to PATH
shell: pwsh
run: |
"$env:USERPROFILE\.dtvem\shims" | Out-File -FilePath $env:GITHUB_PATH -Append
"$env:USERPROFILE\.dtvem\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: "Install Ruby 3.2 via Chocolatey"
shell: pwsh
run: |
# Install Ruby via Chocolatey (will be registered with uru)
choco install ruby --version=3.2.6.1 -y
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
Write-Host "Ruby installed at C:\tools\ruby32"
C:\tools\ruby32\bin\ruby.exe --version
- name: "Install uru"
shell: pwsh
run: |
# Download uru from Bitbucket releases
$uruVersion = "0.8.5"
$uruUrl = "https://bitbucket.org/jonforums/uru/downloads/uru-$uruVersion-windows-x86.7z"
$uruArchive = "$env:TEMP\uru.7z"
$uruDir = "C:\tools\uru"
# Create uru directory
New-Item -ItemType Directory -Force -Path $uruDir | Out-Null
# Download uru
Write-Host "Downloading uru $uruVersion..."
Invoke-WebRequest -Uri $uruUrl -OutFile $uruArchive
# Extract using 7z (available on GitHub runners)
Write-Host "Extracting uru..."
7z x $uruArchive -o"$uruDir" -y
# Add uru to PATH (for subsequent steps)
$uruDir | Out-File -FilePath $env:GITHUB_PATH -Append
# Also add to current PATH (GITHUB_PATH only affects subsequent steps)
$env:Path = "$uruDir;$env:Path"
# Initialize uru (must run from same directory as uru_rt.exe)
Write-Host "Installing uru..."
Push-Location $uruDir
.\uru_rt.exe admin install
Pop-Location
Write-Host "uru installed successfully"
- name: "Register Ruby with uru"
shell: pwsh
run: |
# Register the Chocolatey Ruby with uru
Write-Host "Registering Ruby with uru..."
uru_rt.exe admin add C:\tools\ruby32\bin
Write-Host ""
Write-Host "Registered rubies:"
uru_rt.exe ls
- name: "Verify uru rubies.json exists"
shell: pwsh
run: |
$rubiesJson = "$env:USERPROFILE\.uru\rubies.json"
if (Test-Path $rubiesJson) {
Write-Host "rubies.json found at: $rubiesJson"
Get-Content $rubiesJson
} else {
Write-Host "ERROR: rubies.json not found!"
exit 1
}
- name: "Migrate uru Ruby to dtvem"
shell: bash
run: |
echo "=== Running migrate detection ==="
echo -e "1\n0\n" | ./dist/dtvem.exe migrate ruby || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem.exe list ruby
- name: "Verify migrated version"
shell: bash
run: |
./dist/dtvem.exe list ruby | grep -E "3\.2\." || (echo "ERROR: Expected Ruby 3.2.x to be migrated" && exit 1)
echo "SUCCESS: Ruby 3.2.x was migrated from uru"
- name: Generate summary
if: always()
shell: bash
run: |
echo "## Ruby Migration from uru (Windows)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** uru" >> $GITHUB_STEP_SUMMARY
echo "**Version:** 3.2.x" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem.exe list ruby >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY