Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mac arm #449

Merged
merged 1 commit into from
Apr 15, 2024
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
86 changes: 85 additions & 1 deletion .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/install_in_tests.sh
- git submodule init && git submodule update
Expand Down Expand Up @@ -137,9 +139,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/install_in_tests.sh
- git submodule init && git submodule update
Expand Down Expand Up @@ -180,9 +184,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/install_in_tests.sh
- git submodule init && git submodule update
Expand Down Expand Up @@ -223,9 +229,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/install_in_tests.sh
- git submodule init && git submodule update
Expand Down Expand Up @@ -258,9 +266,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source tests/sftp_server/start_on_mac.sh
- source release/install_in_tests.sh
Expand All @@ -281,9 +291,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/create.sh
- cd ~/$SEMAPHORE_GIT_DIR/
Expand All @@ -307,7 +319,7 @@ blocks:
commands:
- bash tests/sem_service/$TEST

- name: "Bats: Mac"
- name: "Bats: xcode14"
dependencies:
- "Build local CLIs"
task:
Expand All @@ -322,9 +334,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source tests/sftp_server/start_on_mac.sh

Expand Down Expand Up @@ -363,6 +377,64 @@ blocks:
commands:
- 'test-results publish report.xml --name="Bats: Mac" --suite-prefix=$TEST'

- name: "Bats: xcode15 arm"
dependencies:
- "Build local CLIs"
task:
agent:
machine:
type: a2-standard-4
os_image: macos-xcode15

prologue:
commands:
- checkout
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source tests/sftp_server/start_on_mac.sh

jobs:
- name: "Cache tests"
matrix:
- env_var: TEST
values:
- tests/libcheckout.bats
- env_var: SEMAPHORE_CACHE_ARCHIVE_METHOD
values:
- shell-out
- native
- native-parallel
commands:
- source release/install_in_tests.sh
- git submodule init && git submodule update
- sudo ./tests/support/bats-core/install.sh /usr/local
- bats --report-formatter junit --tap --timing $TEST

- name: "Non-cache tests"
matrix:
- env_var: TEST
values:
- tests/artifacts.bats
- tests/test-results.bats
- tests/xcode15_sem_version.bats
- tests/sem-semantic-release.bats
commands:
- source release/install_in_tests.sh
- git submodule init && git submodule update
- sudo ./tests/support/bats-core/install.sh /usr/local
- bats --report-formatter junit --tap --timing $TEST
epilogue:
always:
commands:
- 'test-results publish report.xml --name="Bats: Mac" --suite-prefix=$TEST'

- name: "Bats: Docker"
dependencies:
- "Build local CLIs"
Expand All @@ -380,9 +452,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source tests/sftp_server/start_on_docker.sh
jobs:
Expand Down Expand Up @@ -435,9 +509,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- apk add --update docker openrc
- source tests/sftp_server/start_on_docker.sh
Expand Down Expand Up @@ -484,9 +560,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source tests/sftp_server/start_on_linux.sh
- sudo apt-get install -y python3.8-dev
Expand Down Expand Up @@ -606,9 +684,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/install_in_tests.sh
- git submodule init && git submodule update
Expand Down Expand Up @@ -640,9 +720,11 @@ blocks:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/install_in_tests.sh
- git submodule init && git submodule update
Expand All @@ -666,9 +748,11 @@ after_pipeline:
- 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
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
- bash release/create.sh
- source release/install_in_tests.sh
- test-results gen-pipeline-report
Expand Down
10 changes: 10 additions & 0 deletions release/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ hosted::create_initial_content() {
rm -rf /tmp/Linux
rm -rf /tmp/Linux-arm
rm -rf /tmp/Darwin
rm -rf /tmp/Darwin-arm

mkdir -p /tmp/Linux/toolbox
mkdir -p /tmp/Linux-arm/toolbox
mkdir -p /tmp/Darwin/toolbox
mkdir -p /tmp/Darwin-arm/toolbox

cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Linux/toolbox
cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Linux-arm/toolbox
cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Darwin/toolbox
cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Darwin-arm/toolbox

exclusions=(
.git
Expand All @@ -106,6 +109,7 @@ hosted::create_initial_content() {
rm -rf /tmp/Linux/toolbox/${exclusion}
rm -rf /tmp/Linux-arm/toolbox/${exclusion}
rm -rf /tmp/Darwin/toolbox/${exclusion}
rm -rf /tmp/Darwin-arm/toolbox/${exclusion}
done
}

Expand Down Expand Up @@ -193,17 +197,21 @@ hosted::pack() {
include_external_linux_binary $ARTIFACT_CLI_URL "artifact" /tmp/Linux "x86_64"
include_external_linux_binary $ARTIFACT_CLI_URL "artifact" /tmp/Linux-arm "arm64"
include_external_darwin_binary $ARTIFACT_CLI_URL "artifact" /tmp/Darwin "x86_64"
include_external_darwin_binary $ARTIFACT_CLI_URL "artifact" /tmp/Darwin-arm "arm64"
include_external_linux_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Linux "x86_64"
include_external_linux_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Linux-arm "arm64"
include_external_darwin_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Darwin "x86_64"
include_external_darwin_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Darwin-arm "arm64"
include_external_linux_binary $SPC_CLI_URL "spc" /tmp/Linux "x86_64"
include_external_linux_binary $SPC_CLI_URL "spc" /tmp/Linux-arm "arm64"
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/linux/amd64/cache /tmp/Linux/toolbox/cache
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/linux/arm64/cache /tmp/Linux-arm/toolbox/cache
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/darwin/amd64/cache /tmp/Darwin/toolbox/cache
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/darwin/arm64/cache /tmp/Darwin-arm/toolbox/cache
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/linux/amd64/sem-context /tmp/Linux/toolbox/sem-context
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/linux/arm64/sem-context /tmp/Linux-arm/toolbox/sem-context
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/darwin/amd64/sem-context /tmp/Darwin/toolbox/sem-context
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/darwin/arm64/sem-context /tmp/Darwin-arm/toolbox/sem-context
cp /tmp/when-cli/when /tmp/Linux/toolbox/when
cp /tmp/when-cli/when /tmp/Linux-arm/toolbox/when
}
Expand Down Expand Up @@ -233,6 +241,8 @@ create_tarball "linux.tar" /tmp/Linux
echo "$(create_checksum /tmp/Linux/linux.tar 'linux.tar')" >> /tmp/checksums.txt
create_tarball "darwin.tar" /tmp/Darwin
echo "$(create_checksum /tmp/Darwin/darwin.tar 'darwin.tar')" >> /tmp/checksums.txt
create_tarball "darwin-arm.tar" /tmp/Darwin-arm
echo "$(create_checksum /tmp/Darwin-arm/darwin.tar 'darwin-arm.tar')" >> /tmp/checksums.txt
create_tarball "linux-arm.tar" /tmp/Linux-arm
echo "$(create_checksum /tmp/Linux-arm/linux-arm.tar 'linux-arm.tar')" >> /tmp/checksums.txt

Expand Down
3 changes: 2 additions & 1 deletion release/install_in_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ cd ~
arch=""
case $(uname) in
Darwin)
tar -xvf /tmp/Darwin/darwin.tar -C /tmp
[[ "$(uname -m)" =~ "arm64" ]] && arch="-arm"
tar -xvf /tmp/Darwin${arch}/darwin${arch}.tar -C /tmp
mv /tmp/toolbox ~/.toolbox
;;
Linux)
Expand Down
12 changes: 12 additions & 0 deletions release/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set -euo pipefail
# - /tmp/Linux/linux.tar
# - /tmp/Linux/linux-arm.tar
# - /tmp/Darwin/darwin.tar
# - /tmp/Darwin/darwin-arm.tar
# - /tmp/self-hosted-Linux/linux.tar
# - /tmp/self-hosted-Linux-arm/linux-arm.tar
# - /tmp/self-hosted-Darwin/darwin.tar
Expand Down Expand Up @@ -79,6 +80,17 @@ curl \

echo "darwin.tar uploaded"

curl \
-X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: $(file -b --mime-type /tmp/Darwin/darwin-arm.tar)" \
--data-binary @/tmp/Darwin/darwin.tar \
"https://uploads.github.com/repos/semaphoreci/toolbox/releases/$release_id/assets?name=darwin-arm.tar"

echo "darwin-arm.tar uploaded"


curl \
-X POST \
-H "Authorization: token $GITHUB_TOKEN" \
Expand Down
Loading
Loading