Skip to content

Commit f26302d

Browse files
authored
ci: add PR title validation, Release Please and Rust CI workflows (#1)
1 parent f214972 commit f26302d

File tree

8 files changed

+82
-0
lines changed

8 files changed

+82
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Rust CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
build-and-test:
10+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
11+
with:
12+
rust-version: '1.88.0'
13+
working-directory: "."
14+
enable-cache: true
15+
publish-crates-io: false
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Conventional Commit as PR title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
10+
jobs:
11+
lint-pr-title:
12+
permissions:
13+
pull-requests: read
14+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]

.github/workflows/release.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
16+
secrets: inherit

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[workspace]
2+
resolver = "3"
3+
members = ["add"]

add/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "add"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]

add/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub fn add(left: u64, right: u64) -> u64 {
2+
left + right
3+
}
4+
5+
#[cfg(test)]
6+
mod tests {
7+
use super::*;
8+
9+
#[test]
10+
fn it_works() {
11+
let result = add(2, 2);
12+
assert_eq!(result, 4);
13+
}
14+
}

release-please-config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"draft-pull-request": true,
4+
"include-component-in-tag": false,
5+
"include-v-in-tag": true,
6+
"packages": {
7+
".": {
8+
"release-type": "rust",
9+
"changelog-path": "CHANGELOG.md"
10+
}
11+
}
12+
}
13+

0 commit comments

Comments
 (0)