Skip to content
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

Add GitHub actions #36

Merged
merged 8 commits into from
Oct 5, 2019
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
12 changes: 0 additions & 12 deletions .github/clippy.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on: pull_request

name: CI
jobs:
build_and_test:
name: Build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@master

- name: Install nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: check
uses: actions-rs/cargo@v1
with:
command: check
args: --all --benches --bins --examples --tests

- name: tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all

check_fmt_and_docs:
name: Checking fmt and docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: setup
run: |
rustup default stable
rustup component add rustfmt
rustc --version
- name: fmt
run: cargo fmt --all -- --check

- name: Docs
run: cargo doc
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: pull_request

name: Clippy Check
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- id: component
uses: actions-rs/components-nightly@v1
with:
component: clippy
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ steps.component.outputs.toolchain }}
override: true
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<tr>
<td>Build Status (Windows)</td>
<td>
<a href="https://ci.appveyor.com/project/bastion-rs/bastion/branch/master">
<img src="https://ci.appveyor.com/api/projects/status/ksfqpeuq9gxspnb6/branch/master?svg=true" alt="appveyor build status" />
<a href="https://ci.appveyor.com/project/vertexclique/bastion-4i0dk">
<img src="https://ci.appveyor.com/api/projects/status/pbug23islg80de33/branch/master?svg=true" alt="appveyor build status" />
</a>
</td>
</tr>
Expand Down
9 changes: 3 additions & 6 deletions benches/bench_one_for_one.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ extern crate test;
mod tests {
use super::*;
use bastion::bastion::Bastion;

use bastion::config::BastionConfig;



use log::LevelFilter;

use std::sync::Once;
use std::{thread, time};
use test::Bencher;



static INIT: Once = Once::new();

Expand Down
4 changes: 2 additions & 2 deletions examples/root_spv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bastion::prelude::*;
fn main() {
Bastion::platform();

let message = String::from("Some message to be passed");
let message = String::from("a message");

Bastion::spawn(
|context: BastionContext, msg: Box<dyn Message>| {
Expand All @@ -13,7 +13,7 @@ fn main() {
_ => println!("other message type...")
}

println!("root supervisor - spawn_at_root - 1");
println!("spawned at root");

// Rebind to the system
context.hook();
Expand Down
1 change: 0 additions & 1 deletion examples/spawn_from_context.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bastion::prelude::*;
use log::LevelFilter;


fn main() {
let config = BastionConfig {
log_level: LevelFilter::Debug,
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
//! All up to you. And it should be up to you.
//!

#![doc(html_logo_url = "https://raw.githubusercontent.com/bastion-rs/bastion/master/img/bastion-logo.png")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/bastion-rs/bastion/master/img/bastion-logo.png"
)]

#[macro_use]
extern crate log;
Expand Down
1 change: 0 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! Macros to use in processes and defining the architecture of runtime.
//!


///
/// Matches incoming messages to the process.
/// Always have a `default` case to execute if unknown message arrives to the process.
Expand Down
1 change: 0 additions & 1 deletion src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ impl Supervisor {
}
}


// FIXME: There might be discrepancy between passed self and referenced self.
// Fix this with either passing reference without Box (lifetimes sigh!)
// Or use channels to send back to the supervision tree.
Expand Down
6 changes: 2 additions & 4 deletions tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#[cfg(test)]
mod tests {
use bastion::bastion::Bastion;

use bastion::config::BastionConfig;
use bastion::context::BastionContext;
use bastion::supervisor::SupervisionStrategy;
use log::LevelFilter;

use std::sync::Once;
use std::{fs, thread, time};



static INIT: Once = Once::new();

Expand Down
4 changes: 1 addition & 3 deletions tests/test_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ mod tests {
use bastion::prelude::*;

use log::LevelFilter;

use std::sync::Once;
use std::{thread, time};



static INIT: Once = Once::new();

Expand Down