From 3ac1f540eaf590438bc002529644f19cc2af9ffe Mon Sep 17 00:00:00 2001 From: Alexander Kampf Date: Mon, 5 May 2025 16:13:05 +0200 Subject: [PATCH] chore: Setup repository --- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/bug.md | 22 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature.md | 18 +++++++++++++++++ .github/ISSUE_TEMPLATE/task.md | 18 +++++++++++++++++ .github/dependabot.yml | 28 ++++++++++++++++++++++++++ .github/workflows/lint-pr-title.yml | 24 ++++++++++++++++++++++ .github/workflows/qa.yml | 15 ++++++++++++++ .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++ .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 6 ++++++ Makefile | 9 +++++++++ src/lib.rs | 14 +++++++++++++ 13 files changed, 194 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/feature.md create mode 100644 .github/ISSUE_TEMPLATE/task.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/lint-pr-title.yml create mode 100644 .github/workflows/qa.yml create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 Makefile create mode 100644 src/lib.rs diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..e4dc688 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @thenativeweb/internal_dev diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..595ed28 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,22 @@ +--- +name: Bug +about: Submit a bug to report erroneous behavior that needs to be fixed. +--- + +### What happened incorrectly? + +… + +### What should have happened instead? + +… + +### What steps are needed to reproduce the bug? + +- … +- … +- … + +### What else should we know? + +… diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000..585b5d2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,18 @@ +--- +name: Feature +about: Submit a feature to request or describe new functionality to be added. +--- + +### What is this feature about? + +… + +### What needs to be done to implement this feature? + +- [ ] … +- [ ] … +- [ ] … + +### What else should we know? + +… diff --git a/.github/ISSUE_TEMPLATE/task.md b/.github/ISSUE_TEMPLATE/task.md new file mode 100644 index 0000000..ca05c4c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/task.md @@ -0,0 +1,18 @@ +--- +name: Task +about: Submit a task to describe something that needs to get done. +--- + +### What is this task about? + +… + +### What needs to be done to complete this task? + +- [ ] … +- [ ] … +- [ ] … + +### What else should we know? + +… diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..171643a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,28 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + assignees: + - thenativeweb/internal_dev + labels: + - Dependencies + allow: + - dependency-type: direct + commit-message: + prefix: chore + prefix-development: chore + +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + assignees: + - thenativeweb/internal_dev + labels: + - Dependencies + commit-message: + prefix: chore diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 0000000..c381312 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,24 @@ +name: Lint PR title + +on: + pull_request: + types: + - opened + - edited + - synchronize + +jobs: + lint-pr-title: + name: Lint PR title + runs-on: ubuntu-latest + timeout-minutes: 1 + + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + chore + feat + fix diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..a4f9dfe --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,15 @@ +name: QA + +on: pull_request + +jobs: + qa: + name: QA + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Run QA + run: make qa diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ffe90ab --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + branches: + - 'main' + +permissions: + contents: write + +jobs: + release: + name: Release + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Run QA + run: make qa + - name: Get next version + id: get_next_version + uses: thenativeweb/get-next-version@2.6.3 + - name: Create new version + if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }} + run: | + git tag v${{steps.get_next_version.outputs.version}} + git push origin v${{steps.get_next_version.outputs.version}} 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..fd2f408 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "eventsourcingdb-client-rust" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c40408b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "eventsourcingdb-client-rust" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4eaee04 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +qa: analyze test + +analyze: + @cargo clippy + +test: + @cargo test + +.PHONY: analyze qa test diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}