diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 303333138..d79e2f597 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,6 +27,9 @@ jobs: with: node-version: ${{ env.NODEJS_VERSION }} + - name: Use Beta Toolchain + run: rustup default beta + - name: Setup Cross run: cargo install cross --git https://github.com/cross-rs/cross diff --git a/core/build-cli.sh b/core/build-cli.sh index 2314298d9..e575b8be7 100755 --- a/core/build-cli.sh +++ b/core/build-cli.sh @@ -5,9 +5,15 @@ cd "$(dirname "${BASH_SOURCE[0]}")" set -ea shopt -s expand_aliases +PROFILE=${PROFILE:-release} +if [ "${PROFILE}" = "release" ]; then + BUILD_FLAGS="--release" +fi + if [ -z "${ARCH:-}" ]; then ARCH=$(uname -m) fi + if [ "$ARCH" = "arm64" ]; then ARCH="aarch64" fi @@ -47,4 +53,4 @@ fi echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" -cross build --manifest-path=./core/Cargo.toml --release --no-default-features --features $FEATURE_ARGS --locked --bin start-cli --target=$TARGET \ No newline at end of file +cross build --manifest-path=./core/Cargo.toml $BUILD_FLAGS --no-default-features --features $FEATURE_ARGS --locked --bin start-cli --target=$TARGET \ No newline at end of file diff --git a/core/build-containerbox.sh b/core/build-containerbox.sh index f2003940e..efa0f6fce 100755 --- a/core/build-containerbox.sh +++ b/core/build-containerbox.sh @@ -5,6 +5,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")" set -ea shopt -s expand_aliases +PROFILE=${PROFILE:-release} +if [ "${PROFILE}" = "release" ]; then + BUILD_FLAGS="--release" +fi + if [ -z "$ARCH" ]; then ARCH=$(uname -m) fi @@ -28,4 +33,4 @@ fi echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" -cross build --manifest-path=./core/Cargo.toml --release --no-default-features --features cli-container,$FEATURES --locked --bin containerbox --target=$RUST_ARCH-unknown-linux-musl \ No newline at end of file +cross build --manifest-path=./core/Cargo.toml $BUILD_FLAGS --no-default-features --features cli-container,$FEATURES --locked --bin containerbox --target=$RUST_ARCH-unknown-linux-musl \ No newline at end of file diff --git a/core/build-registrybox.sh b/core/build-registrybox.sh index f95bb8ceb..ec6630d0f 100755 --- a/core/build-registrybox.sh +++ b/core/build-registrybox.sh @@ -5,6 +5,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")" set -ea shopt -s expand_aliases +PROFILE=${PROFILE:-release} +if [ "${PROFILE}" = "release" ]; then + BUILD_FLAGS="--release" +fi + if [ -z "$ARCH" ]; then ARCH=$(uname -m) fi @@ -28,4 +33,4 @@ fi echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" -cross build --manifest-path=./core/Cargo.toml --release --no-default-features --features cli-registry,registry,$FEATURES --locked --bin registrybox --target=$RUST_ARCH-unknown-linux-musl +cross build --manifest-path=./core/Cargo.toml $BUILD_FLAGS --no-default-features --features cli-registry,registry,$FEATURES --locked --bin registrybox --target=$RUST_ARCH-unknown-linux-musl diff --git a/core/build-startbox.sh b/core/build-startbox.sh index b5a3ae943..655566879 100755 --- a/core/build-startbox.sh +++ b/core/build-startbox.sh @@ -1,15 +1,15 @@ #!/bin/bash -PROFILE=${PROFILE:-release} -if [ "${PROFILE}" = "release" ]; then - BUILD_FLAGS="--release" -fi - cd "$(dirname "${BASH_SOURCE[0]}")" set -ea shopt -s expand_aliases +PROFILE=${PROFILE:-release} +if [ "${PROFILE}" = "release" ]; then + BUILD_FLAGS="--release" +fi + if [ -z "$ARCH" ]; then ARCH=$(uname -m) fi diff --git a/core/build-tunnelbox.sh b/core/build-tunnelbox.sh index 7e8445466..da662c9b7 100755 --- a/core/build-tunnelbox.sh +++ b/core/build-tunnelbox.sh @@ -5,6 +5,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")" set -ea shopt -s expand_aliases +PROFILE=${PROFILE:-release} +if [ "${PROFILE}" = "release" ]; then + BUILD_FLAGS="--release" +fi + if [ -z "$ARCH" ]; then ARCH=$(uname -m) fi @@ -28,4 +33,4 @@ fi echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" -cross build --manifest-path=./core/Cargo.toml --release --no-default-features --features cli-tunnel,tunnel,$FEATURES --locked --bin tunnelbox --target=$RUST_ARCH-unknown-linux-musl +cross build --manifest-path=./core/Cargo.toml $BUILD_FLAGS --no-default-features --features cli-tunnel,tunnel,$FEATURES --locked --bin tunnelbox --target=$RUST_ARCH-unknown-linux-musl diff --git a/core/run-tests.sh b/core/run-tests.sh index c5150a5ee..8798b29b8 100755 --- a/core/run-tests.sh +++ b/core/run-tests.sh @@ -5,6 +5,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")" set -ea shopt -s expand_aliases +PROFILE=${PROFILE:-release} +if [ "${PROFILE}" = "release" ]; then + BUILD_FLAGS="--release" +fi + if [ -z "$ARCH" ]; then ARCH=$(uname -m) fi @@ -30,7 +35,4 @@ source ./core/builder-alias.sh echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" -rust-musl-builder sh -c "apt-get update && apt-get install -y rsync && cd core && cargo test --release --features=test,$FEATURES --workspace --locked --target=$ARCH-unknown-linux-musl -- --skip export_bindings_ && chown \$UID:\$UID target" -if [ "$(ls -nd core/target | awk '{ print $3 }')" != "$UID" ]; then - rust-musl-builder sh -c "cd core && chown -R $UID:$UID target && chown -R $UID:$UID /root/.cargo" -fi \ No newline at end of file +cross test --manifest-path=./core/Cargo.toml $BUILD_FLAGS --features=test,$FEATURES --workspace --locked --target=$ARCH-unknown-linux-musl -- --skip export_bindings_ \ No newline at end of file