Skip to content

Switch from travis to Github Actions and setup bors #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/bors.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = [
"ci-linux (stable, x86_64-unknown-linux-gnu)",
"ci-linux (1.35.0, x86_64-unknown-linux-gnu)",
]
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
push:
branches: [ staging, trying, master ]
pull_request:

name: Continuous integration

jobs:
ci-linux:
runs-on: ubuntu-latest
strategy:
matrix:
# All generated code should be running on stable now
rust: [stable]

# The default target we're compiling on and for
TARGET: [x86_64-unknown-linux-gnu]

include:
# Test MSRV
- rust: 1.35.0
TARGET: x86_64-unknown-linux-gnu

# Test nightly but don't fail
- rust: nightly
experimental: true
TARGET: x86_64-unknown-linux-gnu

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: --target=${{ matrix.TARGET }} --features unstable
- uses: actions-rs/cargo@v1
if: ${{ matrix.TARGET == 'nightly' }}
with:
command: test
args: --target=${{ matrix.TARGET }} --features unstable
20 changes: 20 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
push:
branches: [ staging, trying, master ]
pull_request:

name: Clippy check
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
branches: [ staging, trying, master ]
pull_request:

name: Code formatting check

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions bors.toml

This file was deleted.

20 changes: 0 additions & 20 deletions ci/after_success.sh

This file was deleted.

7 changes: 0 additions & 7 deletions ci/install.sh

This file was deleted.

10 changes: 0 additions & 10 deletions ci/script.sh

This file was deleted.

29 changes: 16 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ where
impl<E> Error<E> {
/// Maps an `Error<E>` to `Error<T>` by applying a function to a contained
/// `Error::Other` value, leaving an `Error::WouldBlock` value untouched.
pub fn map<T, F>(self, op: F) -> Error<T> where F: FnOnce(E) -> T {
pub fn map<T, F>(self, op: F) -> Error<T>
where
F: FnOnce(E) -> T,
{
match self {
Error::Other(e) => Error::Other(op(e)),
Error::WouldBlock => Error::WouldBlock,
Expand Down Expand Up @@ -433,17 +436,18 @@ macro_rules! await {
loop {
#[allow(unreachable_patterns)]
match $e {
Err($crate::Error::Other(e)) => {
Err($crate::Error::Other(e)) =>
{
#[allow(unreachable_code)]
break Err(e)
},
Err($crate::Error::WouldBlock) => {}, // yield (see below)
}
Err($crate::Error::WouldBlock) => {} // yield (see below)
Ok(x) => break Ok(x),
}

yield
}
}
};
}

/// Turns the non-blocking expression `$e` into a blocking operation.
Expand All @@ -465,15 +469,16 @@ macro_rules! block {
loop {
#[allow(unreachable_patterns)]
match $e {
Err($crate::Error::Other(e)) => {
Err($crate::Error::Other(e)) =>
{
#[allow(unreachable_code)]
break Err(e)
},
Err($crate::Error::WouldBlock) => {},
}
Err($crate::Error::WouldBlock) => {}
Ok(x) => break Ok(x),
}
}
}
};
}

/// Future adapter
Expand Down Expand Up @@ -507,10 +512,8 @@ macro_rules! try_nb {
($e:expr) => {
match $e {
Err($crate::Error::Other(e)) => return Err(e),
Err($crate::Error::WouldBlock) => {
return Ok(::futures::Async::NotReady)
},
Err($crate::Error::WouldBlock) => return Ok(::futures::Async::NotReady),
Ok(x) => x,
}
}
};
}
1 change: 1 addition & 0 deletions triagebot.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[assign]