Skip to content

Commit 9079b9e

Browse files
authored
Merge pull request #34 from conduit-rust/ci
Migrate CI to GitHub Actions
2 parents d8a664c + 4903238 commit 9079b9e

File tree

4 files changed

+59
-26
lines changed

4 files changed

+59
-26
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
10+
env:
11+
# minimum supported rust version
12+
MSRV: 1.46.0
13+
14+
jobs:
15+
check:
16+
name: Check
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- run: rustup override set ${{env.MSRV}}
21+
- run: cargo check --workspace --all-targets
22+
env:
23+
RUSTFLAGS: "-D warnings"
24+
25+
tests:
26+
name: Tests
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- run: rustup override set ${{env.MSRV}}
31+
- run: cargo test --workspace
32+
33+
fmt:
34+
name: Rustfmt
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- run: rustup override set ${{env.MSRV}}
39+
- run: rustup component add rustfmt
40+
- run: cargo fmt --all -- --check
41+
42+
clippy:
43+
name: Clippy
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v2
47+
- run: rustup override set ${{env.MSRV}}
48+
- run: rustup component add clippy
49+
- run: cargo clippy --workspace -- --deny warnings

.travis.yml

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

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ license = "MIT"
99
repository = "https://github.com/conduit-rust/conduit"
1010
edition = "2018"
1111

12+
[workspace]
13+
members = ["example"]
14+
1215
[dependencies]
1316
http = "0.2"

src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,17 @@ pub type Extensions = typemap::TypeMap;
8787

8888
pub trait RequestExt {
8989
/// The elapsed time since the start of the request (headers received)
90-
///
90+
///
9191
/// # Panics
92-
///
92+
///
9393
/// This method may panic if the server does not add `StartInstant` to the
9494
/// request extensions, or if it has been removed by the application.
9595
fn elapsed(&self) -> Duration {
96-
self.extensions().find::<StartInstant>().unwrap().0.elapsed()
96+
self.extensions()
97+
.find::<StartInstant>()
98+
.unwrap()
99+
.0
100+
.elapsed()
97101
}
98102

99103
/// The version of HTTP being used

0 commit comments

Comments
 (0)