-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-test-migrate-node-windows-system.yml
More file actions
77 lines (66 loc) · 2.61 KB
/
integration-test-migrate-node-windows-system.yml
File metadata and controls
77 lines (66 loc) · 2.61 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
name: Integration Tests - Migrate Node.js from System (Windows)
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
migrate:
name: Node.js from System (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: "Verify pre-installed Node.js"
shell: pwsh
run: |
Write-Host "System Node.js installed at: $(where.exe node)"
$version = (node --version) -replace '^v', ''
Write-Host "Node.js version: $version"
# Save version for later verification
"NODE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: "Migrate system Node.js to dtvem"
shell: bash
run: |
echo "=== Running migrate detection ==="
echo -e "1\n0\n" | ./dist/dtvem.exe migrate node || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem.exe list node
- name: "Verify migrated version"
shell: bash
run: |
# Check that we have the same version that was pre-installed
./dist/dtvem.exe list node | grep -F "$NODE_VERSION" || (echo "ERROR: Expected Node.js $NODE_VERSION to be migrated" && exit 1)
echo "SUCCESS: Node.js $NODE_VERSION was migrated from system"
- name: Generate summary
if: always()
shell: bash
run: |
echo "## Node.js Migration from System (Windows)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** Pre-installed system Node.js" >> $GITHUB_STEP_SUMMARY
echo "**Version:** $NODE_VERSION" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem.exe list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY