-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-test-migrate-node-macos-fnm.yml
More file actions
76 lines (64 loc) · 2.42 KB
/
integration-test-migrate-node-macos-fnm.yml
File metadata and controls
76 lines (64 loc) · 2.42 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
name: Integration Tests - Migrate Node.js from fnm (macOS)
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
migrate:
name: Node.js from fnm (macOS)
runs-on: macos-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
run: |
go build -v -ldflags="-s -w" -o dist/dtvem ./src
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim
- name: Initialize dtvem
run: ./dist/dtvem init --yes
- name: Add dtvem to PATH
run: |
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH
- name: "Install fnm"
run: |
curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell
echo "$HOME/.local/share/fnm" >> $GITHUB_PATH
- name: "Install Node.js 20.18.0 via fnm"
run: |
export PATH="$HOME/.local/share/fnm:$PATH"
eval "$(fnm env --shell bash)"
fnm install 20.18.0
fnm use 20.18.0
echo "fnm Node.js installed at: $(which node)"
node --version
- name: "Migrate fnm Node.js to dtvem"
run: |
echo "=== Running migrate detection ==="
# Select "all" to migrate all detected versions (system + fnm)
echo -e "all\n0\nn\n" | ./dist/dtvem migrate node || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem list node
- name: "Verify migrated version"
run: |
./dist/dtvem list node | grep -E "20\.18\.0" || (echo "ERROR: Expected Node.js 20.18.0 to be migrated" && exit 1)
echo "SUCCESS: Node.js 20.18.0 was migrated from fnm"
- name: Generate summary
if: always()
run: |
echo "## Node.js Migration from fnm (macOS)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** fnm" >> $GITHUB_STEP_SUMMARY
echo "**Version:** 20.18.0" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY