From 513e603f9075982dfc93be59b0de5b71f669c5c1 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 29 Aug 2025 12:19:58 +0200 Subject: [PATCH 1/3] ci: add PR title validation, Release Please and Rust CI workflows --- .github/workflows/ci.yaml | 15 +++++++++++++++ .github/workflows/conventional-commits.yaml | 15 +++++++++++++++ .github/workflows/release.yaml | 16 ++++++++++++++++ .release-please-manifest.json | 1 + add/Cargo.toml | 6 ++++++ add/src/lib.rs | 14 ++++++++++++++ release-please-config.json | 13 +++++++++++++ 7 files changed, 80 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/conventional-commits.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .release-please-manifest.json create mode 100644 add/Cargo.toml create mode 100644 add/src/lib.rs create mode 100644 release-please-config.json 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..28a18f2 --- /dev/null +++ b/.github/workflows/conventional-commits.yaml @@ -0,0 +1,15 @@ +name: Conventional Commit Check PR Title +description: checks the PR title respects the conventional commit + +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..2f324e5 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,16 @@ +on: + push: + branches: + - main + +permissions: + contents: write + issues: write + pull-requests: write + +name: release-please + +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/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" + } + } +} + From e43fbd80c11a2a931db006ef8496e0862f4ff5b6 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 29 Aug 2025 12:36:39 +0200 Subject: [PATCH 2/3] fix: add missing Cargo.toml --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Cargo.toml 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"] From c692e1794207b2cdd9851a1cf7489f543136a1d5 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 29 Aug 2025 14:02:37 +0200 Subject: [PATCH 3/3] fix: update workflows titles --- .github/workflows/conventional-commits.yaml | 3 +-- .github/workflows/release.yaml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/conventional-commits.yaml b/.github/workflows/conventional-commits.yaml index 28a18f2..d11b1b1 100644 --- a/.github/workflows/conventional-commits.yaml +++ b/.github/workflows/conventional-commits.yaml @@ -1,5 +1,4 @@ -name: Conventional Commit Check PR Title -description: checks the PR title respects the conventional commit +name: Conventional Commit as PR title on: pull_request_target: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2f324e5..c565bf2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,5 @@ +name: Release Please + on: push: branches: @@ -8,8 +10,6 @@ permissions: issues: write pull-requests: write -name: release-please - jobs: release-please: uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/release-please.yml@release-please-v2.0.0