diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ecb2522bb..74a5ea87f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: run: docker build -t volta . working-directory: ./ci/docker - name: Compile and package Volta - run: docker run --volume ${PWD}:/root/workspace --workdir /root/workspace --rm --init --tty volta /root/workspace/ci/build-and-package.sh volta-linux + run: docker run --volume ${PWD}:/root/workspace --workdir /root/workspace --rm --init --tty volta /root/workspace/ci/build-linux.sh volta-linux - name: Upload release artifact uses: actions/upload-artifact@v2 with: @@ -39,7 +39,7 @@ jobs: toolchain: stable override: true - name: Compile and package Volta - run: ./ci/build-and-package.sh volta-macos + run: ./ci/build-macos-x86_64.sh volta-macos - name: Upload release artifact uses: actions/upload-artifact@v2 with: @@ -60,7 +60,7 @@ jobs: target: aarch64-apple-darwin override: true - name: Compile and package Volta - run: ./ci/build-for-arm.sh volta-macos-aarch64 + run: ./ci/build-macos-arm.sh volta-macos-aarch64 - name: Upload release artifact uses: actions/upload-artifact@v2 with: diff --git a/ci/build-and-package.sh b/ci/build-linux.sh old mode 100755 new mode 100644 similarity index 100% rename from ci/build-and-package.sh rename to ci/build-linux.sh diff --git a/ci/build-for-arm.sh b/ci/build-macos-arm.sh similarity index 100% rename from ci/build-for-arm.sh rename to ci/build-macos-arm.sh diff --git a/ci/build-macos-x86_64.sh b/ci/build-macos-x86_64.sh new file mode 100755 index 0000000000..0538b4c011 --- /dev/null +++ b/ci/build-macos-x86_64.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +echo "Building Volta" + +cargo build --release + +echo "Packaging Binaries" + +cd target/release +tar -zcvf "$1.tar.gz" volta volta-shim volta-migrate diff --git a/dev/unix/tests/install-script.bats b/dev/unix/tests/install-script.bats index 7825216f0c..7736c680c9 100644 --- a/dev/unix/tests/install-script.bats +++ b/dev/unix/tests/install-script.bats @@ -40,83 +40,33 @@ END_CARGO_TOML diff <(echo "$output") <(echo "$expected_output") } +# linux +@test "parse_os_info - linux" { + expected_output="linux" -# macos -@test "parse_os_info - macos" { - expected_output="macos" - - run parse_os_info "Darwin" "this is ignored" + run parse_os_info "Linux" [ "$status" -eq 0 ] diff <(echo "$output") <(echo "$expected_output") } -# linux - supported OpenSSL -@test "parse_os_info - linux with supported OpenSSL" { - expected_output="linux-openssl-1.2" +# macos +@test "parse_os_info - macos" { + expected_output="macos" - run parse_os_info "Linux" "OpenSSL 1.2.3a whatever else" + run parse_os_info "Darwin" [ "$status" -eq 0 ] diff <(echo "$output") <(echo "$expected_output") } -# linux - unsupported OpenSSL -@test "parse_os_info - linux with unsupported OpenSSL" { - expected_output=$(echo -e "\033[1;31mError\033[0m: Releases for 'SomeSSL' not currently supported. Supported libraries are: OpenSSL.") - - run parse_os_info "Linux" "SomeSSL 1.2.3a whatever else" - [ "$status" -eq 1 ] - diff <(echo "$output") <(echo "$expected_output") -} - -# linux - unexpected OpenSSL version format -@test "parse_os_info - linux with unexpected OpenSSL format" { - expected_output=$(echo -e "\033[1;31mError\033[0m: Could not determine OpenSSL version for 'Some SSL 1.2.4'.") - - run parse_os_info "Linux" "Some SSL 1.2.4" - [ "$status" -eq 1 ] - diff <(echo "$output") <(echo "$expected_output") -} - # unsupported OS @test "parse_os_info - unsupported OS" { expected_output="" - run parse_os_info "DOS" "doesn't matter" + run parse_os_info "DOS" [ "$status" -eq 1 ] diff <(echo "$output") <(echo "$expected_output") } - -# parsing valid OpenSSL version strings -@test "parse_openssl_version - valid versions" { - expected_output="0.9" - run parse_openssl_version "OpenSSL 0.9.5a 1 Apr 2000" - [ "$status" -eq 0 ] - diff <(echo "$output") <(echo "$expected_output") - - expected_output="1.0" - run parse_openssl_version "OpenSSL 1.0.1e-fips 11 Feb 2013" - [ "$status" -eq 0 ] - diff <(echo "$output") <(echo "$expected_output") -} - -# unsupported OpenSSL library -@test "parse_openssl_version - unsupported library" { - expected_output=$(echo -e "\033[1;31mError\033[0m: Releases for 'LibreSSL' not currently supported. Supported libraries are: OpenSSL.") - run parse_openssl_version "LibreSSL 2.6.5" - [ "$status" -eq 1 ] - diff <(echo "$output") <(echo "$expected_output") -} - -# version string with unexpected format -@test "parse_openssl_version - unexpected format" { - expected_output=$(echo -e "\033[1;31mError\033[0m: Could not determine OpenSSL version for 'Some Weird Version 1.2.3'.") - run parse_openssl_version "Some Weird Version 1.2.3" - [ "$status" -eq 1 ] - diff <(echo "$output") <(echo "$expected_output") -} - - # test element_in helper function @test "element_in works correctly" { run element_in "foo" "foo" "bar" "baz"