From 0c4d332f43c9a5967396fd14e7d9bb660cc93c37 Mon Sep 17 00:00:00 2001 From: m1sk9 Date: Fri, 29 Dec 2023 21:23:25 +0900 Subject: [PATCH] first commit --- .github/FUNDING.yml | 1 + .github/renovate.json | 9 +++++++++ .github/workflows/build.yaml | 30 ++++++++++++++++++++++++++++++ .github/workflows/clippy.yaml | 30 ++++++++++++++++++++++++++++++ .github/workflows/fmt.yaml | 30 ++++++++++++++++++++++++++++++ .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 10 ++++++++++ README.md | 35 +++++++++++++++++++++++++++++++++++ src/lib.rs | 14 ++++++++++++++ 10 files changed, 167 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/renovate.json create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/clippy.yaml create mode 100644 .github/workflows/fmt.yaml create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 README.md create mode 100644 src/lib.rs diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b98f8a2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [approvers, m1sk9] diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..cba9923 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>m1sk9/renovate-config" + ], + "addLabels": [ + "renovate" + ] +} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..f15774d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,30 @@ +name: Build members-assoc-sdk-rust + +on: + push: + branches: + - main + - 'release/v*.*.*' + pull_request: + branches: + - main + - 'release/v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + name: Build members-assoc-sdk-rust + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + - name: Setup toolchain + uses: mkroening/rust-toolchain-toml@v1.2.0 + + - name: Setup cache + uses: Swatinem/rust-cache@v2 + with: + prefix-key: "members-assoc-sdk-rust/gh-actions-cache" + + - name: Run Build + run: cargo build --verbose diff --git a/.github/workflows/clippy.yaml b/.github/workflows/clippy.yaml new file mode 100644 index 0000000..838aac7 --- /dev/null +++ b/.github/workflows/clippy.yaml @@ -0,0 +1,30 @@ +name: clippy + +on: + push: + branches: + - main + - 'release/v*.*.*' + pull_request: + branches: + - main + - 'release/v*.*.*' + +jobs: + clippy: + runs-on: ubuntu-latest + name: clippy members-assoc-sdk-rust + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + - name: Setup toolchain + uses: mkroening/rust-toolchain-toml@v1.2.0 + + - name: Setup cache + uses: Swatinem/rust-cache@v2 + with: + prefix-key: "members-assoc-sdk-rust/gh-actions-cache" + + - name: Run clippy + run: cargo clippy --all-targets --all-features diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml new file mode 100644 index 0000000..822ff5c --- /dev/null +++ b/.github/workflows/fmt.yaml @@ -0,0 +1,30 @@ +name: rustfmt + +on: + push: + branches: + - main + - 'release/v*.*.*' + pull_request: + branches: + - main + - 'release/v*.*.*' + +jobs: + fmt: + runs-on: ubuntu-latest + name: rustfmt members-assoc-sdk-rust + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + - name: Setup toolchain + uses: mkroening/rust-toolchain-toml@v1.2.0 + + - name: Setup cache + uses: Swatinem/rust-cache@v2 + with: + prefix-key: "members-assoc-sdk-rust/gh-actions-cache" + + - name: Run rustfmt + run: cargo fmt --all -- --check diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..6a28847 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "members-assoc-sdk-rust" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..3a433c4 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "members-assoc-sdk-rust" +version = "0.1.0" +edition = "2021" +description = "Rust SDK for approvers/member-assoc" +repository = "https://github.com/approvers/members-assoc-sdk-rust" +readme = "README.md" +license = "MIT" + +[dependencies] diff --git a/README.md b/README.md new file mode 100644 index 0000000..8e63ce9 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# members-assoc-sdk-rust + +Rust SDK for [approvers/members-assoc](https://github.com/approvers/members-assoc). + +## Status of support + +- [ ] `GET /members` +- [ ] `GET /members/{id}` +- [ ] `GET /members/{id}/associations` + +- [ ] `PUT /members/{id}/associations` +- [ ] `DELETE /members/{id}/associations` + +Marginal Development Mackerel members can edit and edit their Discord accounts by logging in with their Discord accounts at [Approvers メンバー情報登録](https://members.approvers.dev/). + +## Installation + +Run `cargo add` or add it to Cargo.toml. + +```shell +cargo add members-assoc-sdk-rust +``` + +```toml +[dependencies] +members-assoc-sdk-rust = "0.1.0" +``` + +## Usage + +```rs +fn main() { + // TODO: +} +``` diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}