Skip to content

Commit f63f2e4

Browse files
committed
ci: Run rustfmt on x86_64-linux only
1 parent 51b3d05 commit f63f2e4

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

.travis.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,30 @@ matrix:
6868

6969
install:
7070
- sh rustup-init.sh --default-toolchain=stable -y
71-
- export PATH="$PATH:$HOME/.cargo/bin"
71+
- . "$HOME"/.cargo/env
7272
- if [ -z "$NO_ADD" ]; then rustup target add "$TARGET"; fi
73-
- rustup component add rustfmt
7473

7574
script:
7675
- mkdir -p target/"$TARGET";
7776
- >
7877
case "$TARGET" in
79-
*-linux-android) DOCKER=android ;; # Android uses a local docker image
80-
*-linux-androideabi) DOCKER=android ;;
81-
*-apple-darwin) ;;
82-
*) DOCKER=$TARGET ;;
78+
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
79+
*-apple-darwin) ;;
80+
*) DOCKER="$TARGET" ;;
8381
esac;
8482
if [ -n "$DOCKER" ]; then
85-
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
83+
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
8684
else
87-
PATH="$HOME/rust/bin:$PATH" sh ci/run.sh;
85+
sh ci/run.sh;
8886
fi
87+
88+
# Check the formatting last because test failures are more interesting to have
89+
# discovered for contributors lacking some platform access for testing beforehand
8990
- if [ "${TARGET}" = x86_64-unknown-linux-gnu ]; then
9091
shellcheck -s dash -e SC1090 -- rustup-init.sh ci/*.sh;
92+
rustup component add rustfmt;
93+
rustfmt -vV;
94+
cargo fmt --all -- --check;
9195
fi
9296

9397
before_deploy:

appveyor.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,16 @@ install:
5757
# add mingw to PATH if necessary
5858
- if defined MINGW_DIR set PATH=C:\msys64\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
5959

60-
# Add rustfmt support
61-
- rustup component add rustfmt
62-
6360
# let's see what we got
6461
- where gcc rustc cargo
6562
- rustc -vV
6663
- cargo -vV
67-
- rustfmt -vV
6864

6965
build: false
7066

7167
test_script:
7268
- cargo build --release --target %TARGET% --locked
7369
- cargo test --release --target %TARGET%
74-
- cargo fmt --all -- --check
7570

7671
notifications:
7772
- provider: Webhook

ci/run.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ set -ex
44

55
rustc -vV
66
cargo -vV
7-
rustfmt -vV
87

98
cargo build --locked -v --release --target "$TARGET" --features vendored-openssl
109

1110
if [ -z "$SKIP_TESTS" ]; then
1211
cargo test --release -p download --target "$TARGET" --features vendored-openssl
1312
cargo test --release --target "$TARGET" --features vendored-openssl
1413
fi
15-
16-
# Check the formatting last because test failures are more interesting to have
17-
# discovered for contributors lacking some platform access for testing beforehand
18-
cargo fmt --all -- --check

0 commit comments

Comments
 (0)