Skip to content

Commit

Permalink
add continuous integration workflows (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades authored Oct 24, 2021
1 parent ea48b9a commit 31b76ff
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 6 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.46"
100 changes: 100 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
on:
push:
branches: [master, develop]
pull_request:

name: Continuous integration

jobs:

check:
name: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [msrv, stable, beta, nightly, macos, windows]
include:
- build: msrv
os: ubuntu-latest
rust: 1.46
- build: stable
os: ubuntu-latest
rust: stable
- build: beta
os: ubuntu-latest
rust: beta
- build: nightly
os: ubuntu-latest
rust: nightly
- build: macos
os: macos-latest
rust: stable
- build: windows
os: windows-latest
rust: stable
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: check

fmt:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

clippy:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: clippy, rustfmt
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --tests --examples

docs:
name: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ futures = { version = "0.3", default-features = false, features = ["alloc"]}

[dev-dependencies]
async-std = "1.3.0"
futures = { version = "0.3", default-features = true}
futures = "0.3"
tokio = { version = "1.12.0", features = ["rt-multi-thread", "macros"] }

[build-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions examples/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ async fn main() {
match system.info.get_version().await {
Ok(v) => println!("Version received: {:?}", v),
Err(RequestError::MavErr(info::InfoError::Unknown(s))) => {
println!("Unknown MAVLink error ({:?})", s)
println!("Unknown MAVLink error ({:?})", s);
}
Err(RequestError::MavErr(info::InfoError::InformationNotReceivedYet(s))) => {
println!("{}", s)
println!("{}", s);
}
Err(RequestError::RpcErr(rpc_err)) => println!("RPC error: {:?}", rpc_err),
};
Expand Down
2 changes: 1 addition & 1 deletion src/generated/telemetry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Into<pb::Covariance> for Covariance {
/// A zero-rotation quaternion is represented by (1,0,0,0).
/// The quaternion could also be written as w + xi + yj + zk.
///
/// For more info see: https://en.wikipedia.org/wiki/Quaternion
/// For more info see: <https://en.wikipedia.org/wiki/Quaternion>
#[derive(Clone, PartialEq, Debug, Default)]
pub struct Quaternion {
/// Quaternion entry 0, also denoted as a
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::all)]

#[allow(clippy::all)]
mod generated;

Expand Down Expand Up @@ -46,6 +48,7 @@ impl System {

#[tonic::async_trait]
trait Connect {
#[allow(clippy::ptr_arg)]
async fn connect(url: &String) -> Result<Self, tonic::transport::Error>
where
Self: Sized;
Expand Down

0 comments on commit 31b76ff

Please sign in to comment.