Skip to content

Commit

Permalink
Merge #489
Browse files Browse the repository at this point in the history
489: Migrate CI to GitHub Actions r=jeehoonkang a=taiki-e

Replaces #488

Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e authored Apr 10, 2020
2 parents 8bda978 + ba25da7 commit 0599b8e
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 124 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
100 changes: 0 additions & 100 deletions .travis.yml

This file was deleted.

19 changes: 18 additions & 1 deletion bors.toml
Original file line number Diff line number Diff line change
@@ -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",
]
2 changes: 1 addition & 1 deletion ci/crossbeam-channel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ci/crossbeam-epoch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ci/crossbeam-skiplist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ci/crossbeam-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ci/crossbeam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
36 changes: 18 additions & 18 deletions crossbeam-channel/tests/mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1685,22 +1685,22 @@ mod select_tests {
let (tx2, rx2) = channel::<i32>();
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())
}
}

Expand All @@ -1713,11 +1713,11 @@ mod select_tests {
let (tx5, rx5) = channel::<i32>();
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)
}
}

Expand All @@ -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())
}
}

Expand All @@ -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();
}
Expand Down

0 comments on commit 0599b8e

Please sign in to comment.