Skip to content

Commit

Permalink
elixir 1.6 for focal
Browse files Browse the repository at this point in the history
  • Loading branch information
bogyo210 committed Sep 20, 2023
1 parent 7292dae commit 6991c99
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ blocks:
task:
agent:
machine:
type: e1-standard-2
type: e2-standard-2
os_image: ubuntu2004
prologue:
commands:
Expand All @@ -146,6 +146,7 @@ blocks:
- env_var: TEST
values:
- php
- elixir
commands:
- bats tests/sem_version_focal/${TEST}.bats

Expand Down
3 changes: 3 additions & 0 deletions sem-install
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ install::install_elixir() {
response1=$(curl --write-out %{http_code} --head --silent --output /dev/null $(install::package_url)/${language}/elixirs_${language_version}.tar.gz)
response2=$(curl --write-out %{http_code} --head --silent --output /dev/null $(install::package_url)/${language}/archives_${language_version}.tar.gz)
case ${language_version} in
"1.6"*)
local erlang_version="20.3"
;;
"1.7"* | "1.8"* | "1.9"* | "1.10"*)
local erlang_version="22.3"
;;
Expand Down
1 change: 1 addition & 0 deletions sem-version
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ version::change_node() {
return $?
}
version::change_elixir() {
[[ "$software_version" == "1.6" ]] && software_version="1.6.6"
[[ "$software_version" == "1.7" ]] && software_version="1.7.4"
[[ "$software_version" == "1.8" ]] && software_version="1.8.2"
[[ "$software_version" == "1.9" ]] && software_version="1.9.4"
Expand Down
68 changes: 68 additions & 0 deletions tests/sem_version_focal/elixir.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bats

load "../support/bats-support/load"
load "../support/bats-assert/load"

setup() {
source /tmp/.env-*
source /opt/change-erlang-version.sh
source /opt/change-python-version.sh
source /opt/change-go-version.sh
source /opt/change-java-version.sh
source /opt/change-scala-version.sh
source /opt/change-firefox-version.sh
source ~/.phpbrew/bashrc
. /home/semaphore/.nvm/nvm.sh
export PATH="$PATH:/home/semaphore/.yarn/bin"
source "/home/semaphore/.kiex/scripts/kiex"
export PATH="/home/semaphore/.rbenv/bin:$PATH"
export NVM_DIR=/home/semaphore/.nvm
export PHPBREW_HOME=/home/semaphore/.phpbrew
eval "$(rbenv init -)"

source ~/.toolbox/toolbox
}

# Elixir
@test "change elixir to 1.6" {
sem-version elixir 1.6
run elixir --version
assert_line --partial "Elixir 1.6"
}

# Elixir
@test "change elixir to 1.7.4" {
sem-version elixir 1.7.4
run elixir --version
assert_line --partial "Elixir 1.7.4"
}

@test "change elixir to 1.11.4" {
sem-version elixir 1.11.4
run elixir --version
assert_line --partial "Elixir 1.11.4"
}

@test "change elixir to 1.12.3" {
sem-version elixir 1.12.3
run elixir --version
assert_line --partial "Elixir 1.12.3"
}

@test "change elixir to 1.13.4" {
sem-version elixir 1.13.4
run elixir --version
assert_line --partial "Elixir 1.13.4"
}

@test "change elixir to 1.14.5" {
sem-version elixir 1.14.5
run elixir --version
assert_line --partial "Elixir 1.14.5"
}

@test "change elixir to 1.15.2" {
sem-version elixir 1.15.2
run elixir --version
assert_line --partial "Elixir 1.15.2"
}

0 comments on commit 6991c99

Please sign in to comment.