diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..bf456b33a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI +on: + pull_request: + push: + branches: + - master + - staging + - trying + +jobs: + # Test crates on their minimum Rust versions and nightly Rust. + test: + name: test + runs-on: ubuntu-latest + env: + RUST_VERSION: ${{ matrix.rust }} + strategy: + matrix: + crates: + - crossbeam + - crossbeam-channel + - crossbeam-deque + - crossbeam-epoch + - crossbeam-queue + - crossbeam-skiplist + - crossbeam-utils + rust: + - 1.28.0 + - nightly + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} + - name: Add targets + if: matrix.rust == 'nightly' + run: | + rustup target add thumbv7m-none-eabi + rustup target add thumbv6m-none-eabi + # cfg-if 0.1.10 requires Rust 1.31+ so downgrade it. + - name: Downgrade dependencies + if: matrix.rust == '1.28.0' + run: | + cargo generate-lockfile + cargo update -p cfg-if --precise 0.1.9 + - name: Test + run: ./ci/${{ matrix.crates }}.sh + + # Check for duplicate dependencies. + dependencies: + name: dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update nightly && rustup default nightly + - name: dependency tree check + run: ./ci/dependencies.sh + + # Check formatting. + rustfmt: + name: rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable + - name: rustfmt + run: ./ci/rustfmt.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2cbe1f05e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,100 +0,0 @@ -language: rust - -cache: cargo - -branches: - only: - - master - - staging - - trying - -matrix: - fast_finish: true - include: - - # Test crates on their minimum Rust versions. - - rust: 1.28.0 - name: "crossbeam on 1.28.0" - script: ./ci/crossbeam.sh - - rust: 1.28.0 - name: "crossbeam-channel on 1.28.0" - script: ./ci/crossbeam-channel.sh - - rust: 1.28.0 - name: "crossbeam-deque on 1.28.0" - script: ./ci/crossbeam-deque.sh - - rust: 1.28.0 - name: "crossbeam-epoch on 1.28.0" - script: ./ci/crossbeam-epoch.sh - - rust: 1.28.0 - name: "crossbeam-queue on 1.28.0" - script: ./ci/crossbeam-queue.sh - - rust: 1.28.0 - name: "crossbeam-skiplist on 1.28.0" - script: ./ci/crossbeam-skiplist.sh - - rust: 1.28.0 - name: "crossbeam-utils on 1.28.0" - script: ./ci/crossbeam-utils.sh - - # Test crates on nightly Rust. - - rust: nightly - name: "crossbeam on nightly" - script: ./ci/crossbeam.sh - install: - - rustup target add thumbv7m-none-eabi - - rustup target add thumbv6m-none-eabi - - rust: nightly - name: "crossbeam-channel on nightly" - script: ./ci/crossbeam-channel.sh - - rust: nightly - name: "crossbeam-deque on nightly" - script: ./ci/crossbeam-deque.sh - - rust: nightly - name: "crossbeam-epoch on nightly" - script: ./ci/crossbeam-epoch.sh - install: - - rustup target add thumbv7m-none-eabi - - rustup target add thumbv6m-none-eabi - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise - - llvm-toolchain-precise-3.8 - packages: - - llvm-3.8 - - llvm-3.8-dev - - clang-3.8 - - clang-3.8-dev - - rust: nightly - name: "crossbeam-queue on nightly" - script: ./ci/crossbeam-queue.sh - - rust: nightly - name: "crossbeam-skiplist on nightly" - script: ./ci/crossbeam-skiplist.sh - install: - - rustup target add thumbv7m-none-eabi - - rustup target add thumbv6m-none-eabi - - rust: nightly - name: "crossbeam-utils on nightly" - script: ./ci/crossbeam-utils.sh - install: - - rustup target add thumbv7m-none-eabi - - rustup target add thumbv6m-none-eabi - - # Check for duplicate dependencies. - - rust: nightly - name: "dependency tree check" - script: ./ci/dependencies.sh - - # Check formatting. - - rust: stable - name: "rustfmt" - script: ./ci/rustfmt.sh - -before_script: - # cfg-if 0.1.10 requires Rust 1.31+ so downgrade it. - - | - if [[ "$TRAVIS_RUST_VERSION" == "1.28.0" ]]; then - cargo generate-lockfile - cargo update -p cfg-if --precise 0.1.9 - fi diff --git a/bors.toml b/bors.toml index 359f8947b..483988da3 100644 --- a/bors.toml +++ b/bors.toml @@ -1 +1,18 @@ -status = ["continuous-integration/travis-ci/push"] +status = [ + "test (crossbeam, 1.28.0)", + "test (crossbeam, nightly)", + "test (crossbeam-channel, 1.28.0)", + "test (crossbeam-channel, nightly)", + "test (crossbeam-deque, 1.28.0)", + "test (crossbeam-deque, nightly)", + "test (crossbeam-epoch, 1.28.0)", + "test (crossbeam-epoch, nightly)", + "test (crossbeam-queue, 1.28.0)", + "test (crossbeam-queue, nightly)", + "test (crossbeam-skiplist, 1.28.0)", + "test (crossbeam-skiplist, nightly)", + "test (crossbeam-utils, 1.28.0)", + "test (crossbeam-utils, nightly)", + "dependencies", + "rustfmt", +] diff --git a/ci/crossbeam-channel.sh b/ci/crossbeam-channel.sh index b21e65544..def0c72f3 100755 --- a/ci/crossbeam-channel.sh +++ b/ci/crossbeam-channel.sh @@ -8,7 +8,7 @@ export RUSTFLAGS="-D warnings" cargo check --bins --examples --tests cargo test -- --test-threads=1 -if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then +if [[ "$RUST_VERSION" == "nightly" ]]; then cd benchmarks cargo check --bins fi diff --git a/ci/crossbeam-epoch.sh b/ci/crossbeam-epoch.sh index 3f18e3148..789aa9096 100755 --- a/ci/crossbeam-epoch.sh +++ b/ci/crossbeam-epoch.sh @@ -9,7 +9,7 @@ cargo check --no-default-features cargo check --bins --examples --tests cargo test -if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then +if [[ "$RUST_VERSION" == "nightly" ]]; then cargo check --no-default-features --features nightly cargo test --features nightly diff --git a/ci/crossbeam-skiplist.sh b/ci/crossbeam-skiplist.sh index 3232a1f14..3c4ee95e9 100755 --- a/ci/crossbeam-skiplist.sh +++ b/ci/crossbeam-skiplist.sh @@ -9,7 +9,7 @@ cargo check --no-default-features cargo check --bins --examples --tests cargo test -if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then +if [[ "$RUST_VERSION" == "nightly" ]]; then cargo check --no-default-features --features nightly cargo test --features nightly diff --git a/ci/crossbeam-utils.sh b/ci/crossbeam-utils.sh index 3095ea9e5..9d4bf8c78 100755 --- a/ci/crossbeam-utils.sh +++ b/ci/crossbeam-utils.sh @@ -9,7 +9,7 @@ cargo check --no-default-features cargo check --bins --examples --tests cargo test -if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then +if [[ "$RUST_VERSION" == "nightly" ]]; then cargo check --no-default-features --features nightly cargo test --features nightly diff --git a/ci/crossbeam.sh b/ci/crossbeam.sh index 24e1739c8..42c18dfb9 100755 --- a/ci/crossbeam.sh +++ b/ci/crossbeam.sh @@ -9,7 +9,7 @@ cargo check --no-default-features cargo check --bins --examples --tests cargo test -if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then +if [[ "$RUST_VERSION" == "nightly" ]]; then cargo check --no-default-features --features nightly cargo test --features nightly diff --git a/crossbeam-channel/tests/mpsc.rs b/crossbeam-channel/tests/mpsc.rs index 213b9d8b7..4851f9ee3 100644 --- a/crossbeam-channel/tests/mpsc.rs +++ b/crossbeam-channel/tests/mpsc.rs @@ -1685,22 +1685,22 @@ mod select_tests { let (tx2, rx2) = channel::(); tx1.send(1).unwrap(); select! { - foo = rx1.recv() => { assert_eq!(foo.unwrap(), 1); }, - _bar = rx2.recv() => { panic!() } + foo = rx1.recv() => assert_eq!(foo.unwrap(), 1), + _bar = rx2.recv() => panic!() } tx2.send(2).unwrap(); select! { - _foo = rx1.recv() => { panic!() }, - bar = rx2.recv() => { assert_eq!(bar.unwrap(), 2) } + _foo = rx1.recv() => panic!(), + bar = rx2.recv() => assert_eq!(bar.unwrap(), 2) } drop(tx1); select! { - foo = rx1.recv() => { assert!(foo.is_err()); }, - _bar = rx2.recv() => { panic!() } + foo = rx1.recv() => assert!(foo.is_err()), + _bar = rx2.recv() => panic!() } drop(tx2); select! { - bar = rx2.recv() => { assert!(bar.is_err()); } + bar = rx2.recv() => assert!(bar.is_err()) } } @@ -1713,11 +1713,11 @@ mod select_tests { let (tx5, rx5) = channel::(); tx5.send(4).unwrap(); select! { - _foo = rx1.recv() => { panic!("1") }, - _foo = rx2.recv() => { panic!("2") }, - _foo = rx3.recv() => { panic!("3") }, - _foo = rx4.recv() => { panic!("4") }, - foo = rx5.recv() => { assert_eq!(foo.unwrap(), 4); } + _foo = rx1.recv() => panic!("1"), + _foo = rx2.recv() => panic!("2"), + _foo = rx3.recv() => panic!("3"), + _foo = rx4.recv() => panic!("4"), + foo = rx5.recv() => assert_eq!(foo.unwrap(), 4) } } @@ -1728,8 +1728,8 @@ mod select_tests { drop(tx2); select! { - _a1 = rx1.recv() => { panic!() }, - a2 = rx2.recv() => { assert!(a2.is_err()); } + _a1 = rx1.recv() => panic!(), + a2 = rx2.recv() => assert!(a2.is_err()) } } @@ -1751,13 +1751,13 @@ mod select_tests { }); select! { - a = rx1.recv() => { assert_eq!(a.unwrap(), 1); }, - _b = rx2.recv() => { panic!() } + a = rx1.recv() => assert_eq!(a.unwrap(), 1), + _b = rx2.recv() => panic!() } tx3.send(1).unwrap(); select! { - a = rx1.recv() => { assert!(a.is_err()) }, - _b = rx2.recv() => { panic!() } + a = rx1.recv() => assert!(a.is_err()), + _b = rx2.recv() => panic!() } t.join().unwrap(); }