-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-test-migrate-ruby-ubuntu-rbenv.yml
More file actions
82 lines (70 loc) · 2.85 KB
/
integration-test-migrate-ruby-ubuntu-rbenv.yml
File metadata and controls
82 lines (70 loc) · 2.85 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
name: Integration Tests - Migrate Ruby from rbenv (Ubuntu)
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
migrate:
name: Ruby from rbenv (Ubuntu)
runs-on: ubuntu-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 rbenv and ruby-build"
run: |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
# Install Ruby build dependencies
sudo apt-get update
sudo apt-get install -y autoconf patch build-essential rustc libssl-dev libyaml-dev \
libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev
- name: "Install Ruby 3.3.6 via rbenv"
run: |
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
rbenv install 3.3.6
rbenv global 3.3.6
echo "rbenv Ruby installed at: $(rbenv which ruby)"
ruby --version
- name: "Migrate rbenv Ruby to dtvem"
run: |
echo "=== Running migrate detection ==="
# Select "all" sources and "0" for all versions (rbenv may not be first source)
echo -e "all\n0\nn\n" | ./dist/dtvem migrate ruby || true
echo ""
echo "=== Verifying migration ==="
./dist/dtvem list ruby
- name: "Verify migrated version"
run: |
./dist/dtvem list ruby | grep -E "3\.3\.6" || (echo "ERROR: Expected Ruby 3.3.6 to be migrated" && exit 1)
echo "SUCCESS: Ruby 3.3.6 was migrated from rbenv"
- name: Generate summary
if: always()
run: |
echo "## Ruby Migration from rbenv (Ubuntu)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Source:** rbenv" >> $GITHUB_STEP_SUMMARY
echo "**Version:** 3.3.6" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installed Versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./dist/dtvem list ruby >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No versions" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY