Skip to content

Commit 1f4865b

Browse files
authored
Merge pull request #145 from stevenroose/less-travis-jobs
Use less Travis jobs
2 parents 73514f9 + 42e26c2 commit 1f4865b

File tree

4 files changed

+56
-28
lines changed

4 files changed

+56
-28
lines changed

.travis.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
language: rust
2-
rust:
3-
- stable
4-
- nightly
5-
- 1.29.0
6-
env:
7-
- BITCOINVERSION=0.18.0
8-
- BITCOINVERSION=0.18.1
9-
- BITCOINVERSION=0.19.0.1
10-
- BITCOINVERSION=0.19.1
11-
- BITCOINVERSION=0.20.0
12-
- BITCOINVERSION=0.20.1
2+
3+
jobs:
4+
include:
5+
- rust: stable
6+
env: RUSTFMTCHECK=true
7+
- rust: nightly
8+
- rust: 1.29.0
9+
# Integration tests
10+
- rust: stable
11+
env: BITCOINVERSION=0.18.0
12+
- rust: stable
13+
env: BITCOINVERSION=0.18.1
14+
- rust: stable
15+
env: BITCOINVERSION=0.19.0.1
16+
- rust: stable
17+
env: BITCOINVERSION=0.19.1
18+
- rust: stable
19+
env: BITCOINVERSION=0.20.0
20+
- rust: stable
21+
env: BITCOINVERSION=0.20.1
1322

1423
script:
1524
- ./contrib/test.sh

contrib/test.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11

2+
set -xe
3+
4+
# Just echo all the relevant env vars to help debug Travis.
5+
echo "TRAVIS_RUST_VERSION: \"$TRAVIS_RUST_VERSION\""
6+
echo "RUSTFMTCHECK: \"$RUSTFMTCHECK\""
7+
echo "BITCOINVERSION: \"$BITCOINVERSION\""
8+
echo "PATH: \"$PATH\""
9+
10+
211
# Pin dependencies for Rust v1.29
312
if [ "$TRAVIS_RUST_VERSION" = "1.29.0" ]; then
413
cargo generate-lockfile --verbose
@@ -10,18 +19,22 @@ if [ "$TRAVIS_RUST_VERSION" = "1.29.0" ]; then
1019
cargo update --verbose --package "serde_derive" --precise "1.0.98"
1120
fi
1221

13-
if [ "$TRAVIS_RUST_VERSION" = "stable" ]; then
22+
if [ -n "$RUSTFMTCHECK" ]; then
1423
rustup component add rustfmt
1524
cargo fmt --all -- --check
1625
fi
1726

27+
# Integration test.
28+
if [ -n "$BITCOINVERSION" ]; then
29+
wget https://bitcoincore.org/bin/bitcoin-core-$BITCOINVERSION/bitcoin-$BITCOINVERSION-x86_64-linux-gnu.tar.gz
30+
tar -xzvf bitcoin-$BITCOINVERSION-x86_64-linux-gnu.tar.gz
31+
export PATH=$PATH:$(pwd)/bitcoin-$BITCOINVERSION/bin
32+
cd integration_test
33+
./run.sh
34+
exit 0
35+
fi
36+
37+
# Regular build/unit test.
1838
cargo build --verbose
1939
cargo test --verbose
2040
cargo build --verbose --examples
21-
22-
# Integration test
23-
wget https://bitcoincore.org/bin/bitcoin-core-$BITCOINVERSION/bitcoin-$BITCOINVERSION-x86_64-linux-gnu.tar.gz
24-
tar -xzvf bitcoin-$BITCOINVERSION-x86_64-linux-gnu.tar.gz
25-
export PATH=$PATH:$(pwd)/bitcoin-$BITCOINVERSION/bin
26-
(cd integration_test && ./run.sh)
27-

integration_test/src/main.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,13 @@ fn test_set_label(cl: &Client) {
311311
assert_eq!(info.labels[0], json::GetAddressInfoResultLabel::Simple("label".into()));
312312
} else {
313313
assert_eq!(info.label.as_ref().unwrap(), "label");
314-
assert_eq!(info.labels[0], json::GetAddressInfoResultLabel::WithPurpose {
315-
name: "label".into(),
316-
purpose: json::GetAddressInfoResultLabelPurpose::Receive,
317-
});
314+
assert_eq!(
315+
info.labels[0],
316+
json::GetAddressInfoResultLabel::WithPurpose {
317+
name: "label".into(),
318+
purpose: json::GetAddressInfoResultLabelPurpose::Receive,
319+
}
320+
);
318321
}
319322

320323
cl.set_label(&addr, "other").unwrap();
@@ -324,10 +327,13 @@ fn test_set_label(cl: &Client) {
324327
assert_eq!(info.labels[0], json::GetAddressInfoResultLabel::Simple("other".into()));
325328
} else {
326329
assert_eq!(info.label.as_ref().unwrap(), "other");
327-
assert_eq!(info.labels[0], json::GetAddressInfoResultLabel::WithPurpose {
328-
name: "other".into(),
329-
purpose: json::GetAddressInfoResultLabelPurpose::Receive,
330-
});
330+
assert_eq!(
331+
info.labels[0],
332+
json::GetAddressInfoResultLabel::WithPurpose {
333+
name: "other".into(),
334+
purpose: json::GetAddressInfoResultLabelPurpose::Receive,
335+
}
336+
);
331337
}
332338
}
333339

json/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ pub enum GetAddressInfoResultLabel {
653653
WithPurpose {
654654
name: String,
655655
purpose: GetAddressInfoResultLabelPurpose,
656-
}
656+
},
657657
}
658658

659659
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]

0 commit comments

Comments
 (0)