Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

permissions:
contents: read

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

env:
GVM_NO_GIT_BAK: 1
GVM_NO_UPDATE_PROFILE: 1
SRC_REPO: ${{ github.repositoryUrl }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.17"
- name: Before install
run: binscripts/gvm-installer ${{ github.sha }} tmp
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Run tests
run: |-
gem install tf -v '>=0.4.1'
rake default scenario
6 changes: 4 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ task :default do
Dir.mktmpdir('gvm-test') do |tmpdir|
system(<<-EOSH) || fail
bash -c '
set -e
#{root_path}/binscripts/gvm-installer #{commit} #{tmpdir}
source #{tmpdir}/gvm/scripts/gvm

set -e
tf --text #{tmpdir}/gvm/tests/*.sh
'
EOSH
Expand All @@ -30,9 +31,10 @@ task :scenario do
Dir.mktmpdir('gvm-test') do |tmpdir|
system(<<-EOSH) || fail
bash -c '
set -e
#{root_path}/binscripts/gvm-installer #{commit} #{tmpdir}
source #{tmpdir}/gvm/scripts/gvm

set -e
tf --text #{tmpdir}/gvm/tests/scenario/#{name}
'
EOSH
Expand Down
18 changes: 9 additions & 9 deletions tests/00gvm_install_comment_test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## Cleanup test objects
gvm uninstall go1.4.3 > /dev/null 2>&1
gvm uninstall go1.20.7 > /dev/null 2>&1
gvm uninstall master > /dev/null 2>&1
gvm uninstall go1.6.4 > /dev/null 2>&1
gvm uninstall go1.7.6 > /dev/null 2>&1
gvm uninstall go1.21.4 > /dev/null 2>&1
gvm uninstall go1.23.6 > /dev/null 2>&1
#######################

gvm install go1.4.3 #status=0
GOROOT_BOOTSTRAP=$GVM_ROOT/gos/go1.4.3 gvm install master #status=0
gvm install go1.20.7 #status=0
GOROOT_BOOTSTRAP=$GVM_ROOT/gos/go1.20.7 gvm install go1.21.4 #status=0
gvm list #status=0; match=/go1.21.4/
GOROOT_BOOTSTRAP=$GVM_ROOT/gos/go1.20.7 gvm install go1.23.6 #status=0
gvm list #status=0; match=/go1.23.6/
GOROOT_BOOTSTRAP=$GVM_ROOT/gos/go1.23.6 gvm install master #status=0
gvm list #status=0; match=/master/
GOROOT_BOOTSTRAP=$GVM_ROOT/gos/go1.4.3 gvm install go1.6.4 #status=0
gvm list #status=0; match=/go1.6.4/
GOROOT_BOOTSTRAP=$GVM_ROOT/gos/go1.4.3 gvm install go1.7.6 #status=0
gvm list #status=0; match=/go1.7.6/
14 changes: 7 additions & 7 deletions tests/gvm_alias_comment_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ gvm alias delete bar
#######################

gvm alias # status=0
gvm alias create foo go1.7.6 # status=0
gvm alias create bar go1.6.4 # status=0
gvm alias list # status=0; match=/gvm go aliases/; match=/foo \(go1\.7\.6\)/; match=/bar \(go1\.6\.4\)/
gvm alias create foo go1.23.6 # status=0
gvm alias create bar go1.21.4 # status=0
gvm alias list # status=0; match=/gvm go aliases/; match=/foo \(go1\.23\.6\)/; match=/bar \(go1\.21\.4\)/
gvm use foo # status=0
go version # status=0; match=/go1\.7\.6/
go version # status=0; match=/go1\.23\.6/
gvm use bar # status=0
go version # status=0; match=/go1\.6\.4/
go version # status=0; match=/go1\.21\.4/
gvm alias delete foo
gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.7\.6\)/; match=/bar \(go1\.6\.4\)/
gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.23\.6\)/; match=/bar \(go1\.21\.4\)/
gvm alias delete bar
gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.7\.6\)/; match!=/bar \(go1\.6\.4\)/
gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.23\.6\)/; match!=/bar \(go1\.21\.4\)/
8 changes: 4 additions & 4 deletions tests/gvm_use_comment_test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source $GVM_ROOT/scripts/gvm
gvm use go1.7.6 # status=0
go version # status=0; match=/go1\.7\.6/
gvm use go1.6.4 # status=0
go version # status=0; match=/go1\.6\.4/
gvm use go1.23.6 # status=0
go version # status=0; match=/go1\.23\.6/
gvm use go1.21.4 # status=0
go version # status=0; match=/go1\.21\.4/
1 change: 0 additions & 1 deletion tests/scenario/gvm_install_1.2.2_binary_comment_test.sh

This file was deleted.

1 change: 1 addition & 0 deletions tests/scenario/gvm_install_1.20.2_comment_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gvm install go1.20.2 #status=0
1 change: 1 addition & 0 deletions tests/scenario/gvm_install_1.21.3_binary_comment_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gvm install go1.21.3 --binary #status=0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gvm install go1.23.5 --prefer-binary #status=0
1 change: 0 additions & 1 deletion tests/scenario/gvm_install_1.4.3_comment_test.sh

This file was deleted.

This file was deleted.

Loading