Skip to content

Commit 42f0ee7

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

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
@@ -393,7 +393,10 @@ where
393393
impl<E> Error<E> {
394394
/// Maps an `Error<E>` to `Error<T>` by applying a function to a contained
395395
/// `Error::Other` value, leaving an `Error::WouldBlock` value untouched.
396-
pub fn map<T, F>(self, op: F) -> Error<T> where F: FnOnce(E) -> T {
396+
pub fn map<T, F>(self, op: F) -> Error<T>
397+
where
398+
F: FnOnce(E) -> T,
399+
{
397400
match self {
398401
Error::Other(e) => Error::Other(op(e)),
399402
Error::WouldBlock => Error::WouldBlock,
@@ -433,17 +436,18 @@ macro_rules! await {
433436
loop {
434437
#[allow(unreachable_patterns)]
435438
match $e {
436-
Err($crate::Error::Other(e)) => {
439+
Err($crate::Error::Other(e)) =>
440+
{
437441
#[allow(unreachable_code)]
438442
break Err(e)
439-
},
440-
Err($crate::Error::WouldBlock) => {}, // yield (see below)
443+
}
444+
Err($crate::Error::WouldBlock) => {} // yield (see below)
441445
Ok(x) => break Ok(x),
442446
}
443447

444448
yield
445449
}
446-
}
450+
};
447451
}
448452

449453
/// Turns the non-blocking expression `$e` into a blocking operation.
@@ -465,15 +469,16 @@ macro_rules! block {
465469
loop {
466470
#[allow(unreachable_patterns)]
467471
match $e {
468-
Err($crate::Error::Other(e)) => {
472+
Err($crate::Error::Other(e)) =>
473+
{
469474
#[allow(unreachable_code)]
470475
break Err(e)
471-
},
472-
Err($crate::Error::WouldBlock) => {},
476+
}
477+
Err($crate::Error::WouldBlock) => {}
473478
Ok(x) => break Ok(x),
474479
}
475480
}
476-
}
481+
};
477482
}
478483

479484
/// Future adapter
@@ -507,10 +512,8 @@ macro_rules! try_nb {
507512
($e:expr) => {
508513
match $e {
509514
Err($crate::Error::Other(e)) => return Err(e),
510-
Err($crate::Error::WouldBlock) => {
511-
return Ok(::futures::Async::NotReady)
512-
},
515+
Err($crate::Error::WouldBlock) => return Ok(::futures::Async::NotReady),
513516
Ok(x) => x,
514517
}
515-
}
518+
};
516519
}

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)