Skip to content

Commit

Permalink
Merge pull request #19 from gevulotnetwork/add-ci
Browse files Browse the repository at this point in the history
Add GitHub workflow with basic Rust checks
  • Loading branch information
aleasims authored Nov 19, 2024
2 parents e2cfd8d + c4c508e commit 130534f
Show file tree
Hide file tree
Showing 7 changed files with 507 additions and 163 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check gevulot-rs

on:
pull_request:
push:
branches:
- main
tags:
- "*"

jobs:
test:
name: All gevulot-rs checks
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Protoc
uses: arduino/setup-protoc@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Use Rust cache
uses: Swatinem/rust-cache@v2

- name: Check formatting
run: cargo fmt --check

- name: Check build
run: cargo check --locked

# TODO: re-enable this after fixing all clippy warnings
# - name: Run linting
# run: cargo clippy --locked --no-deps -- --deny warnings

- name: Run runtime-config tests
run: cargo test --locked runtime_config
12 changes: 9 additions & 3 deletions src/event_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ where
async fn process_block_results(&mut self, block_results: &BlockResults) -> Result<()> {
if let Some(events) = &block_results.begin_block_events {
for event in events.iter() {
self.handler.handle_event(event, block_results.height).await?;
self.handler
.handle_event(event, block_results.height)
.await?;
}
}
if let Some(txs_results) = &block_results.txs_results {
Expand All @@ -119,11 +121,15 @@ where
}
if let Some(events) = &block_results.end_block_events {
for event in events.iter() {
self.handler.handle_event(event, block_results.height).await?;
self.handler
.handle_event(event, block_results.height)
.await?;
}
}
for event in block_results.finalize_block_events.iter() {
self.handler.handle_event(event, block_results.height).await?;
self.handler
.handle_event(event, block_results.height)
.await?;
}
Ok(())
}
Expand Down
Loading

0 comments on commit 130534f

Please sign in to comment.