diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 8143387a..f8b82582 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -122,7 +122,7 @@ blocks: task: agent: machine: - type: e1-standard-2 + type: e2-standard-2 os_image: ubuntu2004 prologue: commands: @@ -146,6 +146,7 @@ blocks: - env_var: TEST values: - php + - elixir commands: - bats tests/sem_version_focal/${TEST}.bats diff --git a/sem-install b/sem-install index 97712a78..6d4ebd7d 100644 --- a/sem-install +++ b/sem-install @@ -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" ;; diff --git a/sem-version b/sem-version index 015e0863..e853d1ca 100755 --- a/sem-version +++ b/sem-version @@ -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" diff --git a/tests/sem_version_focal/elixir.bats b/tests/sem_version_focal/elixir.bats new file mode 100644 index 00000000..522dc9e7 --- /dev/null +++ b/tests/sem_version_focal/elixir.bats @@ -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" +}