From 44e88932d331025e3458a08255ab989c2264d8d0 Mon Sep 17 00:00:00 2001 From: Muhammad Mahad Date: Sun, 14 Jul 2024 19:40:37 +0000 Subject: [PATCH] Add CI workflow, PR and issue template Signed-off-by: Muhammad Mahad --- .github/ISSUE_TEMPLATE /bug_report.md | 17 +++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++ .github/workflows/ci.yml | 44 +++++++++++++++++++++++++++ src/main.rs | 2 +- 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE /bug_report.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ci.yml diff --git a/.github/ISSUE_TEMPLATE /bug_report.md b/.github/ISSUE_TEMPLATE /bug_report.md new file mode 100644 index 0000000..9adcfe8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE /bug_report.md @@ -0,0 +1,17 @@ +--- +name: Bug Report +about: Create a bug report to help us improve +labels: bug +title: '[bug] ' +assignees: '' + +--- + +**Describe the bug:** +A clear and concise description of the bug. + +**To Reproduce:** +Steps to reproduce the behavior. + +**Platform/Meta:** +Specify OS, distribution, git sha and hardware platform. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d211d7b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d6ccef4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: Rust Test to DejaGnu -- Build & Test + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + +jobs: + build_and_test: + name: Cargo Build, Test, Clippy, Fmt + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + - beta + - nightly + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + + - name: Cargo Build + run: cargo build --verbose + + - name: Cargo Test + run: cargo test --verbose + + - name: Add rustup components + run: | + rustup component add rustfmt + rustup component add clippy + + + - name: Cargo fmt + run: cargo fmt --all --check + + - name: Clippy check + run: cargo clippy --all-targets --all-features diff --git a/src/main.rs b/src/main.rs index b2c1ec8..cee0c3f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use anyhow::Result; use clap::Parser; -use std::{fs, path, process}; +use std::{fs, path}; #[derive(Parser)] struct Cli {