Skip to content

Commit

Permalink
mac arm sem-version (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
bogyo210 authored Jul 11, 2024
1 parent d1f473e commit c8313bd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 70 deletions.
2 changes: 2 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ blocks:
prologue:
commands:
- checkout
- brew update
- brew upgrade ruby-build
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
Expand Down
4 changes: 2 additions & 2 deletions sem-install
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

install::package_url() {
DIST=$(uname)
[[ $(uname -m) =~ "aarch" ]] && SEMAPHORE_ARCH="arm/" || SEMAPHORE_ARCH=""
[[ $(uname -m) =~ ^(aarch64|arm64)$ ]] && SEMAPHORE_ARCH="arm/" || SEMAPHORE_ARCH=""
case $DIST in
Linux)
echo "http://packages.semaphoreci.com/${SEMAPHORE_ARCH}$(lsb_release -cs)"
;;
Darwin)
echo "http://packagesmac.semaphoreci.com/mac"
[[ "${SEMAPHORE_ARCH}" == "arm/" ]] && echo "http://packages.semaphoreci.com/arm/mac" || echo "http://packagesmac.semaphoreci.com/mac"
;;
*)
echo "Unsupported distro $DIST"
Expand Down
25 changes: 0 additions & 25 deletions tests/macOS_sem_version.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@ setup() {
export NVM_DIR=~/.nvm
}

@test "[macOS] sem-version ruby - 2.5.9 " {

run sem-version ruby 2.5.9
assert_success
run ruby --version
assert_success
assert_output --partial "2.5.9"
}

@test "[macOS] sem-version ruby - 2.6.7 " {

run sem-version ruby 2.6.7
assert_success
run ruby --version
assert_success
assert_output --partial "2.6.7"
}
@test "[macOS] sem-version ruby - 2.7.3 " {

run sem-version ruby 2.7.3
assert_success
run ruby --version
assert_success
assert_output --partial "2.7.3"
}
@test "[macOS] sem-version ruby - 2.7.2 " {

run sem-version ruby 2.7.2
Expand Down
48 changes: 5 additions & 43 deletions tests/xcode15_sem_version.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,20 @@ setup() {
export NVM_DIR=~/.nvm
}

@test "[macOS] sem-version ruby - 2.5.9 " {
@test "[macOS] sem-version ruby - 3.3.3 " {

run sem-version ruby 2.5.9
run sem-version ruby 3.3.3
assert_success
run ruby --version
assert_success
assert_output --partial "2.5.9"
}

@test "[macOS] sem-version ruby - 2.6.7 " {

run sem-version ruby 2.6.7
assert_success
run ruby --version
assert_success
assert_output --partial "2.6.7"
}
@test "[macOS] sem-version ruby - 2.7.3 " {

run sem-version ruby 2.7.3
assert_success
run ruby --version
assert_success
assert_output --partial "2.7.3"
}
@test "[macOS] sem-version ruby - 2.7.2 " {

run sem-version ruby 2.7.2
assert_success
run ruby --version
assert_success
assert_output --partial "2.7.2"
}
@test "[macOS] sem-version ruby - 3.0.1 " {

run sem-version ruby 3.0.1
assert_success
run ruby --version
assert_success
assert_output --partial "3.0.1"
}
@test "[macOS] sem-version php - 8.0.5 " {

run sem-version php 8.0.5
assert_failure
assert_output --partial "3.3.3"
}

@test "[macOS] sem-version node - 14.16.1 " {

run sem-version node 14.16.1
assert_success
assert_output --partial "14.16.1"
node --version
run node --version
assert_success
}

0 comments on commit c8313bd

Please sign in to comment.