generated from axodotdev/oss-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from axodotdev/impl
initial impl
- Loading branch information
Showing
8 changed files
with
678 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Rust | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '11 7 * * 1,4' | ||
|
||
env: | ||
RUSTFLAGS: -Dwarnings | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Run cargo check | ||
run: | | ||
cargo check --all --tests | ||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
- name: Run cargo fmt | ||
run: | | ||
cargo fmt --all -- --check | ||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
- name: Run cargo clippy | ||
run: | | ||
cargo clippy --tests --examples | ||
docs: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTDOCFLAGS: -Dwarnings | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Run rustdoc | ||
run: | | ||
cargo doc --no-deps | ||
feature-check: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@cargo-hack | ||
- name: Run cargo hack powerset | ||
run: | | ||
cargo hack check --feature-powerset --no-dev-deps | ||
os-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
# note that bare "--no-default-features" isn't supported, you must pick a backend! | ||
feature-flags: ["", "--all-features"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Run cargo test | ||
run: | | ||
cargo test ${{ matrix.feature-flags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "axoprocess" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
|
||
[features] | ||
default = [] | ||
stdout_to_stderr_modern = [] | ||
|
||
[dependencies] | ||
miette = "5.10.0" | ||
thiserror = "1.0.50" | ||
tracing = "0.1.40" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//! Errors! | ||
|
||
use miette::Diagnostic; | ||
use thiserror::Error; | ||
|
||
/// Gotta love a newtyped Result | ||
pub type Result<T> = std::result::Result<T, AxoprocessError>; | ||
|
||
/// An error from executing a Command | ||
#[derive(Debug, Error, Diagnostic)] | ||
pub enum AxoprocessError { | ||
/// The command fundamentally failed to execute (usually means it didn't exist) | ||
#[error("failed to {summary}")] | ||
Exec { | ||
/// Summary of what the Command was trying to do | ||
summary: String, | ||
/// What failed | ||
#[source] | ||
cause: std::io::Error, | ||
}, | ||
/// The command ran but signaled some kind of error condition | ||
/// (assuming the exit code is used for that) | ||
#[error("failed to {summary} (status: {status})")] | ||
Status { | ||
/// Summary of what the Command was trying to do | ||
summary: String, | ||
/// What status the Command returned | ||
status: std::process::ExitStatus, | ||
}, | ||
} |
Oops, something went wrong.