This repository was archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtravis-helper.sh
More file actions
executable file
·52 lines (45 loc) · 1.57 KB
/
travis-helper.sh
File metadata and controls
executable file
·52 lines (45 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
action="$1"
# Run unit and integration tests.
if [ "$action" = "test" ]; then
cargo test --verbose
# Check formatting.
elif [ "$action" = "fmt_check" ]; then
if [[ "$TRAVIS_RUST_VERSION" == "stable" && "$TRAVIS_OS_NAME" == "linux" ]]; then
rustup component add rustfmt &&
cargo fmt --verbose -- --check
fi
# Run Clippy.
elif [ "$action" = "clippy_check" ]; then
if [[ "$TRAVIS_RUST_VERSION" == "stable" && "$TRAVIS_OS_NAME" == "linux" ]]; then
rustup component add clippy &&
cargo clippy --verbose
fi
# Upload code coverage report for stable builds in Linux.
elif [ "$action" = "upload_code_coverage" ]; then
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Test" &&
"$TRAVIS_RUST_VERSION" == "stable" &&
"$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
sudo make install &&
cd ../.. &&
rm -rf kcov-master &&
for file in target/debug/abxml-*[^\.d] target/debug/lib-*[^\.d]; do
mkdir -p "target/cov/$(basename $file)";
kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
done &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage"
fi
# Upload development documentation for the develop branch.
elif [ "$action" = "documentation" ]; then
cargo doc -v --document-private-items &&
echo "<meta http-equiv=refresh content=0;url=abxml/index.html>" > target/doc/index.html
fi
exit $?