Skip to content

Commit 922d8cb

Browse files
committed
Switch from travis to Github Actions and setup bors
Signed-off-by: Daniel Egger <[email protected]>
1 parent bd1e329 commit 922d8cb

File tree

11 files changed

+111
-86
lines changed

11 files changed

+111
-86
lines changed

.github/bors.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
block_labels = ["needs-decision"]
2+
delete_merged_branches = true
3+
required_approvals = 1
4+
status = [
5+
"ci-linux (stable, x86_64-unknown-linux-gnu)",
6+
"ci-linux (1.35.0, x86_64-unknown-linux-gnu)",
7+
]

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Continuous integration
7+
8+
jobs:
9+
ci-linux:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
# All generated code should be running on stable now
14+
rust: [stable]
15+
16+
# The default target we're compiling on and for
17+
TARGET: [x86_64-unknown-linux-gnu]
18+
19+
include:
20+
# Test MSRV
21+
- rust: 1.35.0
22+
TARGET: x86_64-unknown-linux-gnu
23+
24+
# Test nightly but don't fail
25+
- rust: nightly
26+
experimental: true
27+
TARGET: x86_64-unknown-linux-gnu
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions-rs/toolchain@v1
32+
with:
33+
profile: minimal
34+
toolchain: ${{ matrix.rust }}
35+
target: ${{ matrix.TARGET }}
36+
override: true
37+
- uses: actions-rs/cargo@v1
38+
with:
39+
command: check
40+
args: --target=${{ matrix.TARGET }} --features unstable
41+
- uses: actions-rs/cargo@v1
42+
with:
43+
command: test
44+
args: --target=${{ matrix.TARGET }} --features unstable

.github/workflows/clippy.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Clippy check
7+
jobs:
8+
clippy_check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions-rs/toolchain@v1
13+
with:
14+
profile: minimal
15+
toolchain: stable
16+
override: true
17+
components: clippy
18+
- uses: actions-rs/clippy-check@v1
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rustfmt.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Code formatting check
7+
8+
jobs:
9+
fmt:
10+
name: Rustfmt
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions-rs/toolchain@v1
15+
with:
16+
profile: minimal
17+
toolchain: stable
18+
override: true
19+
components: rustfmt
20+
- uses: actions-rs/cargo@v1
21+
with:
22+
command: fmt
23+
args: --all -- --check

.travis.yml

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

bors.toml

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

ci/after_success.sh

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

ci/install.sh

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

ci/script.sh

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

src/lib.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,10 @@ where
389389
impl<E> Error<E> {
390390
/// Maps an `Error<E>` to `Error<T>` by applying a function to a contained
391391
/// `Error::Other` value, leaving an `Error::WouldBlock` value untouched.
392-
pub fn map<T, F>(self, op: F) -> Error<T> where F: FnOnce(E) -> T {
392+
pub fn map<T, F>(self, op: F) -> Error<T>
393+
where
394+
F: FnOnce(E) -> T,
395+
{
393396
match self {
394397
Error::Other(e) => Error::Other(op(e)),
395398
Error::WouldBlock => Error::WouldBlock,
@@ -429,17 +432,18 @@ macro_rules! await {
429432
loop {
430433
#[allow(unreachable_patterns)]
431434
match $e {
432-
Err($crate::Error::Other(e)) => {
435+
Err($crate::Error::Other(e)) =>
436+
{
433437
#[allow(unreachable_code)]
434438
break Err(e)
435-
},
436-
Err($crate::Error::WouldBlock) => {}, // yield (see below)
439+
}
440+
Err($crate::Error::WouldBlock) => {} // yield (see below)
437441
Ok(x) => break Ok(x),
438442
}
439443

440444
yield
441445
}
442-
}
446+
};
443447
}
444448

445449
/// Turns the non-blocking expression `$e` into a blocking operation.
@@ -461,15 +465,16 @@ macro_rules! block {
461465
loop {
462466
#[allow(unreachable_patterns)]
463467
match $e {
464-
Err($crate::Error::Other(e)) => {
468+
Err($crate::Error::Other(e)) =>
469+
{
465470
#[allow(unreachable_code)]
466471
break Err(e)
467-
},
468-
Err($crate::Error::WouldBlock) => {},
472+
}
473+
Err($crate::Error::WouldBlock) => {}
469474
Ok(x) => break Ok(x),
470475
}
471476
}
472-
}
477+
};
473478
}
474479

475480
/// Future adapter
@@ -503,10 +508,8 @@ macro_rules! try_nb {
503508
($e:expr) => {
504509
match $e {
505510
Err($crate::Error::Other(e)) => return Err(e),
506-
Err($crate::Error::WouldBlock) => {
507-
return Ok(::futures::Async::NotReady)
508-
},
511+
Err($crate::Error::WouldBlock) => return Ok(::futures::Async::NotReady),
509512
Ok(x) => x,
510513
}
511-
}
514+
};
512515
}

triagebot.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[assign]

0 commit comments

Comments
 (0)