diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9997e9b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,16 @@ +name: Build, Lint and Test +on: [push] +jobs: + Build-Lint-Test: + runs-on: [self-hosted] + steps: + - uses: actions/checkout@v2 + - name: Format + run: | + cargo fmt --all -- --check + - name: Clippy + run: | + cargo clippy -- -D warnings + - name: Test + run: | + cargo test --features=fail-on-warnings diff --git a/Cargo.toml b/Cargo.toml index 82577b0..7b4a791 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,5 +9,8 @@ repository = "https://github.com/nilssonk/rugged" categories = ["network-programming", "command-line-utilities"] edition = "2021" +[features] +fail-on-warnings = [] + [dependencies] rl2tp = "0.2.0" diff --git a/src/main.rs b/src/main.rs index e7a11a9..49dd9b0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +#![cfg_attr(feature = "fail-on-warnings", deny(warnings))] + fn main() { println!("Hello, world!"); }