From 9d54c57b182903505c9a6a5e220cf06c0a7a69d6 Mon Sep 17 00:00:00 2001 From: Gwo Tzu-Hsing Date: Tue, 16 Jul 2024 12:00:45 +0800 Subject: [PATCH] chore: add .github --- .github/ISSUE_TEMPLATE/bug-report.md | 22 ++++++++ .github/ISSUE_TEMPLATE/feature-request.md | 19 +++++++ .github/ISSUE_TEMPLATE/question.md | 12 +++++ .github/workflows/ci.yml | 65 +++++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md create mode 100644 .github/ISSUE_TEMPLATE/question.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 00000000..cc648e99 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,22 @@ +--- +name: "\U0001F41B Bug Report" +about: Something isn't working as expected + +--- + +## Bug Report + +**What version of Elsm are you using?** + + +**What version of Rust are you using?** + + +**What's the status of the running?** + +**What did you do?** + + +**What did you expect to see?** + +**What did you see instead?** diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 00000000..cb6e994f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,19 @@ +--- +name: "\U0001F680 Feature Request" +about: I have a suggestion + +--- + +## Feature Request + +**Is your feature request related to a problem? Please describe:** + + +**Describe the feature you'd like:** + + +**Describe alternatives you've considered:** + + +**Teachability, Documentation, Adoption, Migration Strategy:** + diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 00000000..047e5b0b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,12 @@ +--- +name: "\U0001F914 Question" +about: Usage question that isn't answered in docs or discussion + +--- + +## Question + +Before asking a question, make sure you have: + +- Reviewed relevant Rust information: Google your error messages and look at official docs. +- Searched open and closed [GitHub issues](https://github.com/from-the-basement/elsm/issues) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..391f9a75 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + CARGO_REGISTRIES_MY_REGISTRY_INDEX: https://github.com/rust-lang/crates.io-index + +jobs: + # 1 + check: + name: Rust project check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install latest + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Install Protoc + uses: arduino/setup-protoc@v2 + + # `cargo check` command here will use installed `nightly` + # as it is set as an "override" for current directory + + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + # 2 + fmt: + name: Rust fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: rustfmt, clippy + + # `cargo check` command here will use installed `nightly` + # as it is set as an "override" for current directory + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check