Add clippy check before bake
Some checks failed
ci / Run clippy analysis (push) Successful in 18s
ci / Build and push Docker images (push) Failing after 12m44s

This commit is contained in:
Garen Tyler 2025-05-01 21:31:41 -06:00
parent 5ad4ad7cc2
commit a4838723f5
Signed by: garentyler
SSH Key Fingerprint: SHA256:G4ke7blZMdpWPbkescyZ7IQYE4JAtwpI85YoJdq+S7U
4 changed files with 43 additions and 80 deletions

View File

@ -1,37 +1,44 @@
name: ci
on:
push:
branches: ["main"]
push:
branches: ["main"]
jobs:
bake:
name: Build and push Docker images
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to git.garen.dev Container Registry
uses: docker/login-action@v3
with:
registry: git.garen.dev
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64, linux/arm64
- name: Bake and push
uses: docker/bake-action@v6
with:
files: docker-bake.hcl
source: .
push: true
clippy:
name: Run clippy analysis
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --all-targets --all-features
bake:
name: Build and push Docker images
runs-on: ubuntu-latest
needs: clippy
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to git.garen.dev Container Registry
uses: docker/login-action@v3
with:
registry: git.garen.dev
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64, linux/arm64
- name: Bake and push
uses: docker/bake-action@v6
with:
files: docker-bake.hcl
source: .
push: true

View File

@ -1,44 +0,0 @@
name: clippy
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
jobs:
clippy:
name: Run rust-clippy analyzing
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
with:
profile: minimal
toolchain: nightly
components: clippy
override: true
- name: Install required cargo
run: cargo install clippy-sarif sarif-fmt
- name: Run rust-clippy
run:
cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true

View File

@ -1,4 +1,4 @@
use crate::protocol::mctypes::VarInt;
use crate::protocol::types::VarInt;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
pub struct Sniffer {

View File

@ -11,7 +11,7 @@ use error::{Error, NetworkError};
use tokio::net::TcpStream;
use tokio::task::JoinHandle;
use tokio_util::sync::CancellationToken;
use tracing::{debug, error, info, trace};
use tracing::{info, trace};
#[derive(Debug)]
pub struct Proxy {
@ -91,7 +91,7 @@ impl App for Proxy {
};
let mut client_error = false;
let mut server_error = false;
let server_error = false;
// At the same time, try to read packets from the server and client.
// Forward the packet onto the other.
@ -140,7 +140,7 @@ impl App for Proxy {
}
}
Err(e) => {
server_error = true;
// server_error = true;
return match e {
NetworkError::Parsing => {
trace!("Got invalid data from upstream");