Skip to content

Commit 16bcfdb

Browse files
authored
Merge pull request #3 from flashbots/peg/add-simple-ci
Add simple CI to run cargo test
2 parents 17e56c3 + adf31b4 commit 16bcfdb

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_and_test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Set up Rust
14+
uses: dtolnay/rust-toolchain@stable
15+
with:
16+
toolchain: stable
17+
components: rustfmt, clippy
18+
19+
- name: Cache dependencies
20+
uses: actions/cache@v3
21+
with:
22+
path: |
23+
~/.cargo/registry
24+
~/.cargo/git
25+
target
26+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-cargo-
29+
30+
- name: Run cargo clippy
31+
run: cargo clippy -- -D warnings
32+
33+
- name: Run cargo test
34+
run: cargo test

src/lib.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ impl ProxyServer {
3939
.with_single_cert(cert_chain.clone(), key)
4040
.expect("Failed to create rustls server config");
4141

42-
let server =
43-
Self::new_with_tls_config(cert_chain, server_config.into(), local, target).await;
44-
45-
server
42+
Self::new_with_tls_config(cert_chain, server_config.into(), local, target).await
4643
}
4744

4845
/// Start with preconfigured TLS
@@ -133,10 +130,7 @@ impl ProxyClient {
133130
.with_root_certificates(root_store)
134131
.with_no_client_auth();
135132

136-
let client =
137-
Self::new_with_tls_config(client_config.into(), address, server_address, server_name)
138-
.await;
139-
client
133+
Self::new_with_tls_config(client_config.into(), address, server_address, server_name).await
140134
}
141135

142136
pub async fn new_with_tls_config(
@@ -151,7 +145,7 @@ impl ProxyClient {
151145
Self {
152146
connector,
153147
listener,
154-
target: target.into(),
148+
target,
155149
target_name,
156150
attestation_platform: MockAttestation,
157151
}

0 commit comments

Comments
 (0)