Skip to content

Commit 85e99d0

Browse files
authored
feat(ci): add weekly integration test workflow (#123)
1 parent 5e1c138 commit 85e99d0

23 files changed

Lines changed: 2147 additions & 3 deletions

.claude/CLAUDE.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ Guidance for Claude Code when working with the dtvem codebase.
2121
2. **Write tests** - All new/refactored code requires comprehensive unit tests
2222
3. **Cross-platform** - All features must work on Windows, macOS, and Linux
2323
4. **Conventional commits** - Format: `type(scope): description`
24-
5. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files
25-
6. **Run validation before commits** - Run `npm run check` (format, lint, test) before committing and pushing
26-
24+
5. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files. Use conventional commit format for issue titles
25+
6. **Pull Requests** - Use the conventional commit format for PR titles as you do for commits
26+
7. **Run validation before commits** - Run `npm run check` (format, lint, test) before committing and pushing
27+
8. **Working an issue** - When working an issue, always create a new branch from an updated main branch
28+
9. **Branch Names** - Always use the conventional commit `type` from the issue title as the first prefix, and the `scope` as the second, then a very short description, example `feat/ci/integration-tests`
2729
---
2830

2931
## Quick Reference

.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

0 commit comments

Comments
 (0)