Skip to content

Commit 356afab

Browse files
committed
feat(ci): add weekly integration test workflow
Add comprehensive integration tests that run weekly to verify: - Runtime installation, listing, and version management - Shim execution and version switching - Local/global version configuration - Migration from system installs and version managers Workflow structure (21 reusable workflows): - 3 runtime installation tests (Node.js, Python, Ruby) - 17 migration tests covering system and version manager sources - 1 main orchestrator calling all workflows Migration tests cover: - Node.js: system (apt/Homebrew/Chocolatey), nvm, fnm, nvm-windows - Python: system (apt/Homebrew/Chocolatey), pyenv, pyenv-win - Ruby: system (apt/Homebrew/Chocolatey), rbenv (Unix only) Also excludes integration-test*.yml from triggering build.yml. Closes #115
1 parent 5e1c138 commit 356afab

22 files changed

Lines changed: 2142 additions & 0 deletions

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- '.github/workflows/generate-changelog.yml'
1313
- '.github/workflows/preview-changelog.yml'
1414
- '.github/workflows/contributors.yml'
15+
- '.github/workflows/integration-test*.yml'
1516
- '.idea/**'
1617
- '.claude/**'
1718
- '.gitignore'
@@ -32,6 +33,7 @@ on:
3233
- '.github/workflows/generate-changelog.yml'
3334
- '.github/workflows/preview-changelog.yml'
3435
- '.github/workflows/contributors.yml'
36+
- '.github/workflows/integration-test*.yml'
3537
- '.idea/**'
3638
- '.claude/**'
3739
- '.gitignore'
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Integration Tests - Migrate Node.js from fnm (macOS)
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
migrate:
12+
name: Node.js from fnm (macOS)
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
cache: true
23+
24+
- name: Build dtvem
25+
run: |
26+
go build -v -ldflags="-s -w" -o dist/dtvem ./src
27+
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim
28+
29+
- name: Initialize dtvem
30+
run: ./dist/dtvem init --yes
31+
32+
- name: Add dtvem to PATH
33+
run: |
34+
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
35+
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH
36+
37+
- name: "Install fnm"
38+
run: |
39+
curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell
40+
echo "$HOME/.local/share/fnm" >> $GITHUB_PATH
41+
42+
- name: "Install Node.js 20.18.0 via fnm"
43+
run: |
44+
export PATH="$HOME/.local/share/fnm:$PATH"
45+
eval "$(fnm env --shell bash)"
46+
fnm install 20.18.0
47+
fnm use 20.18.0
48+
echo "fnm Node.js installed at: $(which node)"
49+
node --version
50+
51+
- name: "Migrate fnm Node.js to dtvem"
52+
run: |
53+
echo "=== Running migrate detection ==="
54+
echo -e "1\n0\nn\n" | ./dist/dtvem migrate node || true
55+
echo ""
56+
echo "=== Verifying migration ==="
57+
./dist/dtvem list node
58+
59+
- name: "Verify migrated version"
60+
run: |
61+
./dist/dtvem list node | grep -E "20\.18\.0" || (echo "ERROR: Expected Node.js 20.18.0 to be migrated" && exit 1)
62+
echo "SUCCESS: Node.js 20.18.0 was migrated from fnm"
63+
64+
- name: Generate summary
65+
if: always()
66+
run: |
67+
echo "## Node.js Migration from fnm (macOS)" >> $GITHUB_STEP_SUMMARY
68+
echo "" >> $GITHUB_STEP_SUMMARY
69+
echo "**Source:** fnm" >> $GITHUB_STEP_SUMMARY
70+
echo "**Version:** 20.18.0" >> $GITHUB_STEP_SUMMARY
71+
echo "" >> $GITHUB_STEP_SUMMARY
72+
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
73+
echo '```' >> $GITHUB_STEP_SUMMARY
74+
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
75+
echo '```' >> $GITHUB_STEP_SUMMARY
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Integration Tests - Migrate Node.js from System (macOS)
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
migrate:
12+
name: Node.js from System (macOS)
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
cache: true
23+
24+
- name: Build dtvem
25+
run: |
26+
go build -v -ldflags="-s -w" -o dist/dtvem ./src
27+
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim
28+
29+
- name: Initialize dtvem
30+
run: ./dist/dtvem init --yes
31+
32+
- name: Add dtvem to PATH
33+
run: |
34+
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
35+
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH
36+
37+
- name: "Install Node.js 18.x via Homebrew"
38+
run: |
39+
brew install node@18
40+
brew link --overwrite node@18
41+
echo "System Node.js installed at: $(which node)"
42+
node --version
43+
44+
- name: "Migrate system Node.js to dtvem"
45+
run: |
46+
echo "=== Running migrate detection ==="
47+
echo -e "1\n0\n" | ./dist/dtvem migrate node || true
48+
echo ""
49+
echo "=== Verifying migration ==="
50+
./dist/dtvem list node
51+
52+
- name: "Verify migrated version"
53+
run: |
54+
./dist/dtvem list node | grep -E "18\." || (echo "ERROR: Expected Node.js 18.x to be migrated" && exit 1)
55+
echo "SUCCESS: Node.js 18.x was migrated from system"
56+
57+
- name: Generate summary
58+
if: always()
59+
run: |
60+
echo "## Node.js Migration from System (macOS)" >> $GITHUB_STEP_SUMMARY
61+
echo "" >> $GITHUB_STEP_SUMMARY
62+
echo "**Source:** Homebrew" >> $GITHUB_STEP_SUMMARY
63+
echo "**Version:** 18.x" >> $GITHUB_STEP_SUMMARY
64+
echo "" >> $GITHUB_STEP_SUMMARY
65+
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
66+
echo '```' >> $GITHUB_STEP_SUMMARY
67+
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
68+
echo '```' >> $GITHUB_STEP_SUMMARY
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Integration Tests - Migrate Node.js from nvm (Ubuntu)
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
migrate:
12+
name: Node.js from nvm (Ubuntu)
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
cache: true
23+
24+
- name: Build dtvem
25+
run: |
26+
go build -v -ldflags="-s -w" -o dist/dtvem ./src
27+
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim
28+
29+
- name: Initialize dtvem
30+
run: ./dist/dtvem init --yes
31+
32+
- name: Add dtvem to PATH
33+
run: |
34+
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
35+
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH
36+
37+
- name: "Install Node.js 20.18.0 via nvm"
38+
run: |
39+
# nvm is preinstalled on Ubuntu runners
40+
export NVM_DIR="$HOME/.nvm"
41+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
42+
nvm install 20.18.0
43+
nvm use 20.18.0
44+
echo "nvm Node.js installed at: $(which node)"
45+
node --version
46+
47+
- name: "Migrate nvm Node.js to dtvem"
48+
run: |
49+
echo "=== Running migrate detection ==="
50+
echo -e "1\n0\nn\n" | ./dist/dtvem migrate node || true
51+
echo ""
52+
echo "=== Verifying migration ==="
53+
./dist/dtvem list node
54+
55+
- name: "Verify migrated version"
56+
run: |
57+
./dist/dtvem list node | grep -E "20\.18\.0" || (echo "ERROR: Expected Node.js 20.18.0 to be migrated" && exit 1)
58+
echo "SUCCESS: Node.js 20.18.0 was migrated from nvm"
59+
60+
- name: Generate summary
61+
if: always()
62+
run: |
63+
echo "## Node.js Migration from nvm (Ubuntu)" >> $GITHUB_STEP_SUMMARY
64+
echo "" >> $GITHUB_STEP_SUMMARY
65+
echo "**Source:** nvm" >> $GITHUB_STEP_SUMMARY
66+
echo "**Version:** 20.18.0" >> $GITHUB_STEP_SUMMARY
67+
echo "" >> $GITHUB_STEP_SUMMARY
68+
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
69+
echo '```' >> $GITHUB_STEP_SUMMARY
70+
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
71+
echo '```' >> $GITHUB_STEP_SUMMARY
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Integration Tests - Migrate Node.js from System (Ubuntu)
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
migrate:
12+
name: Node.js from System (Ubuntu)
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
cache: true
23+
24+
- name: Build dtvem
25+
run: |
26+
go build -v -ldflags="-s -w" -o dist/dtvem ./src
27+
go build -v -ldflags="-s -w" -o dist/dtvem-shim ./src/cmd/shim
28+
29+
- name: Initialize dtvem
30+
run: ./dist/dtvem init --yes
31+
32+
- name: Add dtvem to PATH
33+
run: |
34+
echo "$HOME/.dtvem/shims" >> $GITHUB_PATH
35+
echo "$HOME/.dtvem/bin" >> $GITHUB_PATH
36+
37+
- name: "Install Node.js 18.x via apt (NodeSource)"
38+
run: |
39+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
40+
sudo apt-get install -y nodejs
41+
echo "System Node.js installed at: $(which node)"
42+
node --version
43+
44+
- name: "Migrate system Node.js to dtvem"
45+
run: |
46+
echo "=== Running migrate detection ==="
47+
echo -e "1\n0\n" | ./dist/dtvem migrate node || true
48+
echo ""
49+
echo "=== Verifying migration ==="
50+
./dist/dtvem list node
51+
52+
- name: "Verify migrated version"
53+
run: |
54+
# Check that we have a version starting with 18
55+
./dist/dtvem list node | grep -E "18\." || (echo "ERROR: Expected Node.js 18.x to be migrated" && exit 1)
56+
echo "SUCCESS: Node.js 18.x was migrated from system"
57+
58+
- name: Generate summary
59+
if: always()
60+
run: |
61+
echo "## Node.js Migration from System (Ubuntu)" >> $GITHUB_STEP_SUMMARY
62+
echo "" >> $GITHUB_STEP_SUMMARY
63+
echo "**Source:** apt (NodeSource)" >> $GITHUB_STEP_SUMMARY
64+
echo "**Version:** 18.x" >> $GITHUB_STEP_SUMMARY
65+
echo "" >> $GITHUB_STEP_SUMMARY
66+
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
67+
echo '```' >> $GITHUB_STEP_SUMMARY
68+
./dist/dtvem list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
69+
echo '```' >> $GITHUB_STEP_SUMMARY
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Integration Tests - Migrate Node.js from nvm-windows (Windows)
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
migrate:
12+
name: Node.js from nvm-windows (Windows)
13+
runs-on: windows-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
cache: true
23+
24+
- name: Build dtvem
25+
shell: bash
26+
run: |
27+
go build -v -ldflags="-s -w" -o dist/dtvem.exe ./src
28+
go build -v -ldflags="-s -w" -o dist/dtvem-shim.exe ./src/cmd/shim
29+
30+
- name: Initialize dtvem
31+
shell: bash
32+
run: ./dist/dtvem.exe init --yes
33+
34+
- name: Add dtvem to PATH
35+
shell: pwsh
36+
run: |
37+
"$env:USERPROFILE\.dtvem\shims" | Out-File -FilePath $env:GITHUB_PATH -Append
38+
"$env:USERPROFILE\.dtvem\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
39+
40+
- name: "Install nvm-windows"
41+
shell: pwsh
42+
run: |
43+
choco install nvm -y
44+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
45+
46+
- name: "Install Node.js 20.18.0 via nvm-windows"
47+
shell: pwsh
48+
run: |
49+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
50+
nvm install 20.18.0
51+
nvm use 20.18.0
52+
Write-Host "nvm-windows Node.js version:"
53+
node --version
54+
55+
- name: "Migrate nvm-windows Node.js to dtvem"
56+
shell: bash
57+
run: |
58+
echo "=== Running migrate detection ==="
59+
echo -e "1\n0\nn\n" | ./dist/dtvem.exe migrate node || true
60+
echo ""
61+
echo "=== Verifying migration ==="
62+
./dist/dtvem.exe list node
63+
64+
- name: "Verify migrated version"
65+
shell: bash
66+
run: |
67+
./dist/dtvem.exe list node | grep -E "20\.18\.0" || (echo "ERROR: Expected Node.js 20.18.0 to be migrated" && exit 1)
68+
echo "SUCCESS: Node.js 20.18.0 was migrated from nvm-windows"
69+
70+
- name: Generate summary
71+
if: always()
72+
shell: bash
73+
run: |
74+
echo "## Node.js Migration from nvm-windows (Windows)" >> $GITHUB_STEP_SUMMARY
75+
echo "" >> $GITHUB_STEP_SUMMARY
76+
echo "**Source:** nvm-windows" >> $GITHUB_STEP_SUMMARY
77+
echo "**Version:** 20.18.0" >> $GITHUB_STEP_SUMMARY
78+
echo "" >> $GITHUB_STEP_SUMMARY
79+
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
80+
echo '```' >> $GITHUB_STEP_SUMMARY
81+
./dist/dtvem.exe list node >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
82+
echo '```' >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)