mirror of
https://github.com/TECHNOFAB11/aerosol.git
synced 2025-12-11 23:50:07 +01:00
Merge pull request #4 from bradfier/update-ci-publish
Update CI and bump crate version to 0.3.0
This commit is contained in:
commit
bf981a1f3b
8 changed files with 181 additions and 70 deletions
24
.github/workflows/publish.yml
vendored
Normal file
24
.github/workflows/publish.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
name: Publish
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: login
|
||||
args: -- ${{secrets.CARGO_TOKEN}}
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: publish
|
||||
96
.github/workflows/toolchain.yml
vendored
Normal file
96
.github/workflows/toolchain.yml
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
on: [push, pull_request]
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --all-features
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- run: rustup component add rustfmt
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: -- --check
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- run: rustup component add clippy
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: --all-features -- -D warnings
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all-features
|
||||
|
||||
test_minimum:
|
||||
name: Test (1.35.0)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: 1.35.0
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all-features
|
||||
|
||||
test_beta:
|
||||
name: Test (Beta)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: beta
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all-features
|
||||
10
.travis.yml
10
.travis.yml
|
|
@ -1,10 +0,0 @@
|
|||
language: rust
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
matrix:
|
||||
allow_failures:
|
||||
- rust: nightly
|
||||
fast_finish: true
|
||||
cache: cargo
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "aerosol"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
authors = ["Diggory Blake <diggsey@googlemail.com>"]
|
||||
edition = "2018"
|
||||
description = "Dependency injection with compile-time guarantees"
|
||||
|
|
|
|||
|
|
@ -96,11 +96,10 @@
|
|||
#[doc(hidden)]
|
||||
pub extern crate tt_call;
|
||||
|
||||
mod context;
|
||||
mod interface;
|
||||
mod join;
|
||||
mod parse;
|
||||
mod interface;
|
||||
mod context;
|
||||
|
||||
|
||||
/// The building block for this crate. Automatically implemented
|
||||
/// for contexts providing a dependency of type `T`.
|
||||
|
|
@ -113,7 +112,7 @@ pub trait Provide<T> {
|
|||
|
||||
/// Implement this trait to provide a convenient syntax for
|
||||
/// constructing implementations of dependencies.
|
||||
pub trait Factory<Args=()> {
|
||||
pub trait Factory<Args = ()> {
|
||||
type Object;
|
||||
fn build(args: Args) -> Result<Self::Object, anyhow::Error>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#![recursion_limit="512"]
|
||||
#![recursion_limit = "512"]
|
||||
#![allow(clippy::blacklisted_name)]
|
||||
|
||||
extern crate aerosol;
|
||||
#[macro_use]
|
||||
|
|
@ -39,7 +40,9 @@ struct Bar;
|
|||
|
||||
impl aerosol::Factory<(Bar,)> for FooFactory {
|
||||
type Object = Foo;
|
||||
fn build(_: (Bar,)) -> Result<Foo, anyhow::Error> { Ok(Foo) }
|
||||
fn build(_: (Bar,)) -> Result<Foo, anyhow::Error> {
|
||||
Ok(Foo)
|
||||
}
|
||||
}
|
||||
|
||||
aerosol::define_context!(
|
||||
|
|
@ -50,7 +53,6 @@ aerosol::define_context!(
|
|||
);
|
||||
|
||||
fn main() {
|
||||
|
||||
//trace_macros!(true);
|
||||
//aerosol::test_macro!();
|
||||
tt_call! {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue