diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5326f03 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,15 @@ +name: Rust CI + +on: + pull_request: + push: + branches: [main] + +jobs: + build-and-test: + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/rust-build.yml@rust-build-v2.0.0 + with: + rust-version: '1.88.0' + working-directory: "." + enable-cache: true + publish-crates-io: false diff --git a/.github/workflows/conventional-commits.yaml b/.github/workflows/conventional-commits.yaml new file mode 100644 index 0000000..d11b1b1 --- /dev/null +++ b/.github/workflows/conventional-commits.yaml @@ -0,0 +1,14 @@ +name: Conventional Commit as PR title + +on: + pull_request_target: + types: + - opened + - edited + - reopened + +jobs: + lint-pr-title: + permissions: + pull-requests: read + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/conventional-commits.yml@conventional-commits-v1.1.0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c565bf2 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,16 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + release-please: + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/release-please.yml@release-please-v2.0.0 + secrets: inherit diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{} diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..ae06cf1 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +resolver = "3" +members = ["add"] diff --git a/add/Cargo.toml b/add/Cargo.toml new file mode 100644 index 0000000..9cc0d91 --- /dev/null +++ b/add/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "add" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/add/src/lib.rs b/add/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/add/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); + } +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..21ba14e --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "draft-pull-request": true, + "include-component-in-tag": false, + "include-v-in-tag": true, + "packages": { + ".": { + "release-type": "rust", + "changelog-path": "CHANGELOG.md" + } + } +} +