diff --git a/library/compiler-builtins/libm/.travis.yml b/library/compiler-builtins/libm/.travis.yml index ae03b6601973..2bbb60fc64d1 100644 --- a/library/compiler-builtins/libm/.travis.yml +++ b/library/compiler-builtins/libm/.travis.yml @@ -15,6 +15,8 @@ matrix: - env: TARGET=powerpc64-unknown-linux-gnu - env: TARGET=powerpc64le-unknown-linux-gnu - env: TARGET=x86_64-unknown-linux-gnu + - env: TARGET=cargo-fmt + rust: beta before_install: set -e @@ -22,8 +24,6 @@ install: - bash ci/install.sh script: - # code must be already formatted - - cargo fmt -- --check - bash ci/script.sh after_script: set +e diff --git a/library/compiler-builtins/libm/ci/install.sh b/library/compiler-builtins/libm/ci/install.sh index 68dd0f337ac1..4d9552d231bc 100644 --- a/library/compiler-builtins/libm/ci/install.sh +++ b/library/compiler-builtins/libm/ci/install.sh @@ -1,12 +1,15 @@ set -euxo pipefail main() { + if [ $TARGET = cargo-fmt ]; then + rustup component add rustfmt-preview + return + fi + if ! hash cross >/dev/null 2>&1; then cargo install cross fi - rustup component add rustfmt-preview - rustup target add x86_64-unknown-linux-musl if [ $TARGET != x86_64-unknown-linux-gnu ]; then diff --git a/library/compiler-builtins/libm/ci/script.sh b/library/compiler-builtins/libm/ci/script.sh index d29003052508..a4f1b324d660 100644 --- a/library/compiler-builtins/libm/ci/script.sh +++ b/library/compiler-builtins/libm/ci/script.sh @@ -1,6 +1,11 @@ set -euxo pipefail main() { + if [ $TARGET = cargo-fmt ]; then + cargo fmt -- --check + return + fi + # quick check cargo check