Skip to content

Commit

Permalink
chore: add github CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWaWaR committed Sep 24, 2023
1 parent 6652e3a commit 82af159
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Rust

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: check format + clippy
run: make ci
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

fmt:
cargo fmt --all -- --check

clippy:
cargo clippy --all --all-targets --all-features

test:
cargo test

ci: fmt clippy test

.PHONY: clippy fmt test ci
4 changes: 2 additions & 2 deletions akasa-core/src/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ impl AsyncWrite for MockConn {
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<io::Result<usize>> {
let peer = self.peer.clone();
let peer = self.peer;
let mut sink = Pin::new(&mut self.chan_out);
match sink.as_mut().poll_ready(cx) {
Poll::Ready(Ok(())) => {
log::debug!("send to [{}]", peer);
if let Err(_) = sink.as_mut().start_send(buf.to_vec()) {
if sink.as_mut().start_send(buf.to_vec()).is_err() {
return Poll::Ready(Err(io::Error::from(io::ErrorKind::BrokenPipe)));
}
match sink.as_mut().poll_flush(cx) {
Expand Down

0 comments on commit 82af159

Please sign in to comment.