Skip to content

Commit 0599b8e

Browse files
bors[bot]taiki-e
andauthored
489: Migrate CI to GitHub Actions r=jeehoonkang a=taiki-e Replaces crossbeam-rs#488 Co-authored-by: Taiki Endo <te316e89@gmail.com>
2 parents 8bda978 + ba25da7 commit 0599b8e

File tree

9 files changed

+109
-124
lines changed

9 files changed

+109
-124
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- staging
8+
- trying
9+
10+
jobs:
11+
# Test crates on their minimum Rust versions and nightly Rust.
12+
test:
13+
name: test
14+
runs-on: ubuntu-latest
15+
env:
16+
RUST_VERSION: ${{ matrix.rust }}
17+
strategy:
18+
matrix:
19+
crates:
20+
- crossbeam
21+
- crossbeam-channel
22+
- crossbeam-deque
23+
- crossbeam-epoch
24+
- crossbeam-queue
25+
- crossbeam-skiplist
26+
- crossbeam-utils
27+
rust:
28+
- 1.28.0
29+
- nightly
30+
steps:
31+
- uses: actions/checkout@master
32+
- name: Install Rust
33+
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
34+
- name: Add targets
35+
if: matrix.rust == 'nightly'
36+
run: |
37+
rustup target add thumbv7m-none-eabi
38+
rustup target add thumbv6m-none-eabi
39+
# cfg-if 0.1.10 requires Rust 1.31+ so downgrade it.
40+
- name: Downgrade dependencies
41+
if: matrix.rust == '1.28.0'
42+
run: |
43+
cargo generate-lockfile
44+
cargo update -p cfg-if --precise 0.1.9
45+
- name: Test
46+
run: ./ci/${{ matrix.crates }}.sh
47+
48+
# Check for duplicate dependencies.
49+
dependencies:
50+
name: dependencies
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@master
54+
- name: Install Rust
55+
run: rustup update nightly && rustup default nightly
56+
- name: dependency tree check
57+
run: ./ci/dependencies.sh
58+
59+
# Check formatting.
60+
rustfmt:
61+
name: rustfmt
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@master
65+
- name: Install Rust
66+
run: rustup update stable && rustup default stable
67+
- name: rustfmt
68+
run: ./ci/rustfmt.sh

.travis.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

bors.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
status = ["continuous-integration/travis-ci/push"]
1+
status = [
2+
"test (crossbeam, 1.28.0)",
3+
"test (crossbeam, nightly)",
4+
"test (crossbeam-channel, 1.28.0)",
5+
"test (crossbeam-channel, nightly)",
6+
"test (crossbeam-deque, 1.28.0)",
7+
"test (crossbeam-deque, nightly)",
8+
"test (crossbeam-epoch, 1.28.0)",
9+
"test (crossbeam-epoch, nightly)",
10+
"test (crossbeam-queue, 1.28.0)",
11+
"test (crossbeam-queue, nightly)",
12+
"test (crossbeam-skiplist, 1.28.0)",
13+
"test (crossbeam-skiplist, nightly)",
14+
"test (crossbeam-utils, 1.28.0)",
15+
"test (crossbeam-utils, nightly)",
16+
"dependencies",
17+
"rustfmt",
18+
]

ci/crossbeam-channel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export RUSTFLAGS="-D warnings"
88
cargo check --bins --examples --tests
99
cargo test -- --test-threads=1
1010

11-
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
11+
if [[ "$RUST_VERSION" == "nightly" ]]; then
1212
cd benchmarks
1313
cargo check --bins
1414
fi

ci/crossbeam-epoch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cargo check --no-default-features
99
cargo check --bins --examples --tests
1010
cargo test
1111

12-
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
12+
if [[ "$RUST_VERSION" == "nightly" ]]; then
1313
cargo check --no-default-features --features nightly
1414
cargo test --features nightly
1515

ci/crossbeam-skiplist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cargo check --no-default-features
99
cargo check --bins --examples --tests
1010
cargo test
1111

12-
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
12+
if [[ "$RUST_VERSION" == "nightly" ]]; then
1313
cargo check --no-default-features --features nightly
1414
cargo test --features nightly
1515

ci/crossbeam-utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cargo check --no-default-features
99
cargo check --bins --examples --tests
1010
cargo test
1111

12-
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
12+
if [[ "$RUST_VERSION" == "nightly" ]]; then
1313
cargo check --no-default-features --features nightly
1414
cargo test --features nightly
1515

ci/crossbeam.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cargo check --no-default-features
99
cargo check --bins --examples --tests
1010
cargo test
1111

12-
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
12+
if [[ "$RUST_VERSION" == "nightly" ]]; then
1313
cargo check --no-default-features --features nightly
1414
cargo test --features nightly
1515

crossbeam-channel/tests/mpsc.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,22 +1685,22 @@ mod select_tests {
16851685
let (tx2, rx2) = channel::<i32>();
16861686
tx1.send(1).unwrap();
16871687
select! {
1688-
foo = rx1.recv() => { assert_eq!(foo.unwrap(), 1); },
1689-
_bar = rx2.recv() => { panic!() }
1688+
foo = rx1.recv() => assert_eq!(foo.unwrap(), 1),
1689+
_bar = rx2.recv() => panic!()
16901690
}
16911691
tx2.send(2).unwrap();
16921692
select! {
1693-
_foo = rx1.recv() => { panic!() },
1694-
bar = rx2.recv() => { assert_eq!(bar.unwrap(), 2) }
1693+
_foo = rx1.recv() => panic!(),
1694+
bar = rx2.recv() => assert_eq!(bar.unwrap(), 2)
16951695
}
16961696
drop(tx1);
16971697
select! {
1698-
foo = rx1.recv() => { assert!(foo.is_err()); },
1699-
_bar = rx2.recv() => { panic!() }
1698+
foo = rx1.recv() => assert!(foo.is_err()),
1699+
_bar = rx2.recv() => panic!()
17001700
}
17011701
drop(tx2);
17021702
select! {
1703-
bar = rx2.recv() => { assert!(bar.is_err()); }
1703+
bar = rx2.recv() => assert!(bar.is_err())
17041704
}
17051705
}
17061706

@@ -1713,11 +1713,11 @@ mod select_tests {
17131713
let (tx5, rx5) = channel::<i32>();
17141714
tx5.send(4).unwrap();
17151715
select! {
1716-
_foo = rx1.recv() => { panic!("1") },
1717-
_foo = rx2.recv() => { panic!("2") },
1718-
_foo = rx3.recv() => { panic!("3") },
1719-
_foo = rx4.recv() => { panic!("4") },
1720-
foo = rx5.recv() => { assert_eq!(foo.unwrap(), 4); }
1716+
_foo = rx1.recv() => panic!("1"),
1717+
_foo = rx2.recv() => panic!("2"),
1718+
_foo = rx3.recv() => panic!("3"),
1719+
_foo = rx4.recv() => panic!("4"),
1720+
foo = rx5.recv() => assert_eq!(foo.unwrap(), 4)
17211721
}
17221722
}
17231723

@@ -1728,8 +1728,8 @@ mod select_tests {
17281728
drop(tx2);
17291729

17301730
select! {
1731-
_a1 = rx1.recv() => { panic!() },
1732-
a2 = rx2.recv() => { assert!(a2.is_err()); }
1731+
_a1 = rx1.recv() => panic!(),
1732+
a2 = rx2.recv() => assert!(a2.is_err())
17331733
}
17341734
}
17351735

@@ -1751,13 +1751,13 @@ mod select_tests {
17511751
});
17521752

17531753
select! {
1754-
a = rx1.recv() => { assert_eq!(a.unwrap(), 1); },
1755-
_b = rx2.recv() => { panic!() }
1754+
a = rx1.recv() => assert_eq!(a.unwrap(), 1),
1755+
_b = rx2.recv() => panic!()
17561756
}
17571757
tx3.send(1).unwrap();
17581758
select! {
1759-
a = rx1.recv() => { assert!(a.is_err()) },
1760-
_b = rx2.recv() => { panic!() }
1759+
a = rx1.recv() => assert!(a.is_err()),
1760+
_b = rx2.recv() => panic!()
17611761
}
17621762
t.join().unwrap();
17631763
}

0 commit comments

Comments
 (0)