From 405c7c08104bdc7a833cc6df35c2adb8e876a36d Mon Sep 17 00:00:00 2001 From: TheAwiteb Date: Sun, 31 Dec 2023 14:30:28 +0300 Subject: [PATCH] Add `.github` folder, contains the workflows and issue teplates --- .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/bug.md | 35 ++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 16 ++++++++ .github/ISSUE_TEMPLATE/question.md | 12 ++++++ .github/ISSUE_TEMPLATE/typo.md | 16 ++++++++ .github/pull_request_template.md | 12 ++++++ .github/workflows/cd.yml | 26 ++++++++++++ .github/workflows/ci.yml | 50 +++++++++++++++++++++++ 8 files changed, 168 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/ISSUE_TEMPLATE/typo.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..07292fe --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: "TheAwiteb" \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..791263b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,35 @@ +--- +name: Bug +about: Create a bug report to help us improve Lprs +title: '[Bug]: ...' +labels: ["🐞 Bug"] +assignees: '' +--- + +## Checks + +* [ ] I added a descriptive title to this issue +* [ ] I have searched (Google, and GitHub) for similar issues and couldn't find anything +* [ ] I have read [the README](https://github.com/TheAwiteb/lprs/blob/master/README.md) and still think this is a bug + +## Version + + +> Then, run `rustc --version` to get the version of Rust. + +Rust version: `...` + +## Description + + +## The command +```bash +$ lprs ... +``` + +## Expected behavior + + +## Actual behavior + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..574a412 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,16 @@ +--- +name: Feature request +about: Suggest an idea for Lprs +title: '[Feature request]: ...' +labels: ["🔥 Feature"] +assignees: '' +--- + +## Feature description + + +## Example + +```bash +$ lprs ... +``` diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..82775c7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,12 @@ +--- +name: Question +about: Ask a question about Lprs +title: '[Question]: ...' +labels: ["💬 Question"] +assignees: '' +--- + +## Question + + + diff --git a/.github/ISSUE_TEMPLATE/typo.md b/.github/ISSUE_TEMPLATE/typo.md new file mode 100644 index 0000000..a256e66 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/typo.md @@ -0,0 +1,16 @@ +--- +name: Typo report +about: Report a typo in the documentation or the code +title: '[Typo]: ...' +labels: ["📝 Typo"] +assignees: '' +--- + + + +| Location | Suggestion | +|----------|------------| +| GitHub-link| Suggestion | + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..5aebacd --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ + + +## Issue + +This will fix {issue GitHub link} + +## How I am fixing it + \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..a86aefa --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,26 @@ +name: CD + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +jobs: + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + - name: Create Release 🖋 + uses: softprops/action-gh-release@v1 + with: + prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'pre') }} + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + + - name: Publish to crates.io 🚀 + uses: katyo/publish-crates@v2 + with: + token: ${{ secrets.PAT }} + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0625e11 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Rust build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo build --workspace --all-features + rustfmt: + name: Rust format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo fmt -- --check + check: + name: Rust check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --workspace --all-features + clippy: + name: Rust clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo clippy --workspace --all-features -- -D warnings + verify_msrv: + name: Verify Minimum Supported Rust Version in Cargo.toml + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install or use cached `cargo-msrv` + uses: baptiste0928/cargo-install@v2 + with: + crate: cargo-msrv + + - name: Verify Minimum Rust Version + run: cargo-msrv verify