Skip to content

Commit 7371928

Browse files
committed
workflows
1 parent d943471 commit 7371928

2 files changed

Lines changed: 102 additions & 26 deletions

File tree

.github/workflows/rust.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Rust CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install Rust toolchain
19+
uses: dtolnay/rust-toolchain@stable
20+
with:
21+
toolchain: stable
22+
components: rustfmt, clippy
23+
- name: Cache Cargo dependencies
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.cargo/registry
28+
~/.cargo/git
29+
target
30+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-cargo-
33+
- name: Build
34+
run: cargo build --verbose
35+
- name: Run test default
36+
run: cargo test-default
37+
- name: Run test test-pg-1
38+
run: cargo test-pg-1
39+
- name: Run test test-pg-2
40+
run: cargo test-pg-2
41+
- name: Run test test-pg-3
42+
run: cargo test-pg-3
43+
- name: Run test test-pg-4
44+
run: cargo test-pg-4
45+
- name: Run test test-mysql-1
46+
run: cargo test-mysql-1
47+
- name: Run test test-mysql-2
48+
run: cargo test-mysql-2
49+
- name: Run test test-mysql-3
50+
run: cargo test-mysql-3
51+
- name: Run test test-mysql-4
52+
run: cargo test-mysql-4
53+
54+
# You can add a job for Clippy (linter) and Rustfmt (formatter) as well
55+
lint:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Install Rust toolchain
60+
uses: dtolnay/rust-toolchain@stable
61+
with:
62+
toolchain: stable
63+
components: rustfmt, clippy
64+
- name: Run Clippy
65+
run: cargo clippy -- -D warnings
66+
- name: Run Rustfmt
67+
run: cargo fmt --check

README.md

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# 🚌 bus — Lightweight CQRS Framework for Rust
22

3-
#### `bus` is a modular, async-first CQRS framework for Rust that helps you structure your application around clear boundaries: `Commands`, `Queries`, and `Events`. It supports both in-memory and database-backed event processing, middleware pipelines, and graceful shutdown — all with minimal boilerplate.
3+
####
4+
`bus` is a modular, async-first CQRS framework for Rust that helps you structure your application around clear boundaries:
5+
`Commands`, `Queries`, and
6+
`Events`. It supports both in-memory and database-backed event processing, middleware pipelines, and graceful shutdown — all with minimal boilerplate.
47

58
---
69

@@ -11,7 +14,6 @@
1114
* ❌ No clear separation between commands, queries, and events
1215
* ❌ Manual registration of handlers and middleware
1316

14-
1517
## `bus` introduces a clean, extensible architecture for:
1618

1719
* 🧱 Structuring your domain logic with CQRS
@@ -29,7 +31,7 @@
2931
* **Commands** — operations that change state (e.g. CreateUser)
3032
* **Queries** — operations that return data (e.g. GetUserById)
3133
* **Events** — notifications that something happened (e.g. UserCreated)
32-
34+
3335
This separation improves clarity, testability, and scalability.
3436

3537
---
@@ -45,21 +47,24 @@ A command represents an intention to change state. It is handled by a single han
4547
---
4648

4749
## 🔍 Query
50+
4851
A query retrieves data without modifying state. It is also handled by a single handler.
4952

5053
📖 Read more → [query.md](https://github.com/bordunosp/bus/blob/master/doc/query.md)
5154

5255
---
5356

5457
## 📣 Event
58+
5559
An event represents something that has already happened. It can be:
5660

5761
In-memory — handled immediately during bus::publish(...)
5862

5963
Database-backed — persisted and processed asynchronously by background workers
6064

6165
* 📖 Read more → [event.md](https://github.com/bordunosp/bus/blob/master/doc/event.md)
62-
* 📖 Database-backed events → [event_database_sea_orm.md](https://github.com/bordunosp/bus/blob/master/doc/event_database_sea_orm.md)
66+
* 📖 Database-backed
67+
events → [event_database_sea_orm.md](https://github.com/bordunosp/bus/blob/master/doc/event_database_sea_orm.md)
6368

6469
---
6570

@@ -75,9 +80,9 @@ You can wrap handlers with composable pipelines for:
7580

7681
Supported for:
7782

78-
* In-memory events → event_pipeline.md
79-
* Database-backed events → event_database_pipeline.md
80-
* Requests (commands/queries) → request_pipeline.md
83+
* In-memory events → [event_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/event_pipeline.md)
84+
* Database-backed events → [event_database_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/event_database_pipeline.md)
85+
* Requests (commands/queries) → [request_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/request_pipeline.md)
8186

8287
---
8388

@@ -93,13 +98,15 @@ ctor = "0.2" # Required for automatic handler & pipeline registration
9398

9499
**Why `ctor`?**
95100

96-
`bus` uses the `ctor` crate to automatically register handlers and pipelines at startup. Without it, nothing will be wired up.
101+
`bus` uses the `ctor` crate to automatically register handlers and pipelines at startup. Without it, nothing will be
102+
wired up.
97103

98104
---
99105

100106
## 📦 Migrations for Database Events
101107

102-
If you're using database-backed events with SeaORM, you must apply the required database migrations before running workers.
108+
If you're using database-backed events with SeaORM, you must apply the required database migrations before running
109+
workers.
103110

104111
All required migrations are located in the root of the repository under the migration/ directory:
105112

@@ -112,7 +119,8 @@ All required migrations are located in the root of the repository under the migr
112119

113120
[migration](https://github.com/bordunosp/bus/blob/master/migration)
114121

115-
You can apply them using your preferred migration tool (e.g. SeaORM CLI, refinery, sqlx-cli, or manually via psql/MySQL client).
122+
You can apply them using your preferred migration tool (e.g. SeaORM CLI, refinery, sqlx-cli, or manually via psql/MySQL
123+
client).
116124

117125
---
118126

@@ -138,26 +146,27 @@ You can apply them using your preferred migration tool (e.g. SeaORM CLI, refiner
138146

139147
# 📚 Documentation Index
140148

141-
142-
143-
| Topic | File |
144-
|:-------|:---------------------------|
145-
| 🧭 CQRS Overview | this file |
146-
| 🔨 Commands | [command.md](https://github.com/bordunosp/bus/blob/master/doc/command.md) |
147-
| 🔍 Queries | [query.md](https://github.com/bordunosp/bus/blob/master/doc/query.md) |
148-
| 📣 Events (in-memory) | [event.md](https://github.com/bordunosp/bus/blob/master/doc/event.md) |
149-
| 🗃️ Events (database-backed) | [event_database_sea_orm.md](https://github.com/bordunosp/bus/blob/master/doc/event_database_sea_orm.md) |
150-
| 🧩 Event Pipelines (in-memory) | [event_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/event_pipeline.md) |
151-
| 🧩 Event Pipelines (database) | [event_database_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/event_database_pipeline.md) |
152-
| 🧩 Request Pipelines | [request_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/request_pipeline.md) |
153-
| 🛠 Migrations | bus app folder [migration](https://github.com/bordunosp/bus/blob/master/migration) |
154-
149+
| Topic | File |
150+
|:-------------------------------|:----------------------------------------------------------------------------------------------------------|
151+
| 🧭 CQRS Overview | this file |
152+
| 🔨 Commands | [command.md](https://github.com/bordunosp/bus/blob/master/doc/command.md) |
153+
| 🔍 Queries | [query.md](https://github.com/bordunosp/bus/blob/master/doc/query.md) |
154+
| 📣 Events (in-memory) | [event.md](https://github.com/bordunosp/bus/blob/master/doc/event.md) |
155+
| 🗃️ Events (database-backed) | [event_database_sea_orm.md](https://github.com/bordunosp/bus/blob/master/doc/event_database_sea_orm.md) |
156+
| 🧩 Event Pipelines (in-memory) | [event_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/event_pipeline.md) |
157+
| 🧩 Event Pipelines (database) | [event_database_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/event_database_pipeline.md) |
158+
| 🧩 Request Pipelines | [request_pipeline.md](https://github.com/bordunosp/bus/blob/master/doc/request_pipeline.md) |
159+
| 🛠 Migrations | bus app folder [migration](https://github.com/bordunosp/bus/blob/master/migration) |
155160

156161
---
157162

158163
# #StandForUkraine 🇺🇦
159164

160-
This project aims to show support for Ukraine and its people amidst a war that has been ongoing since 2014. This war has a genocidal nature and has led to the deaths of thousands, injuries to millions, and significant property damage. We believe that the international community should focus on supporting Ukraine and ensuring security and freedom for its people.
165+
This project aims to show support for Ukraine and its people amidst a war that has been ongoing since 2014. This war has
166+
a genocidal nature and has led to the deaths of thousands, injuries to millions, and significant property damage. We
167+
believe that the international community should focus on supporting Ukraine and ensuring security and freedom for its
168+
people.
161169

162-
Join us and show your support using the hashtag #StandForUkraine. Together, we can help bring attention to the issues faced by Ukraine and provide aid.
170+
Join us and show your support using the hashtag #StandForUkraine. Together, we can help bring attention to the issues
171+
faced by Ukraine and provide aid.
163172

0 commit comments

Comments
 (0)