fix: allow clippy uninlined_format_args lint to pass CI #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Cache cargo dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
- name: Run clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::uninlined-format-args | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Check documentation | |
run: cargo doc --no-deps | |
security: | |
name: Security Audit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache cargo dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-audit-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install cargo-audit | |
run: cargo install cargo-audit | |
- name: Run security audit | |
run: cargo audit | |
build: | |
name: Build (${{ matrix.target }}) | |
runs-on: ${{ matrix.os }} | |
needs: [test, security] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: docsee-linux-x86_64 | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: docsee-linux-aarch64 | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
name: docsee-macos-x86_64 | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
name: docsee-macos-aarch64 | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
name: docsee-windows-x86_64.exe | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Cache cargo dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.target }}-cargo- | |
- name: Install cross-compilation tools (Linux ARM64) | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
- name: Build binary | |
run: | | |
cargo build --release --target ${{ matrix.target }} | |
- name: Prepare binary (Unix) | |
if: matrix.os != 'windows-latest' | |
run: | | |
cp target/${{ matrix.target }}/release/docsee ${{ matrix.name }} | |
chmod +x ${{ matrix.name }} | |
- name: Prepare binary (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
copy target\${{ matrix.target }}\release\docsee.exe ${{ matrix.name }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.name }} | |
retention-days: 30 | |
integration-test: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
needs: [test] | |
services: | |
docker: | |
image: docker:dind | |
options: --privileged | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache cargo dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-integration-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build application | |
run: cargo build --release | |
- name: Test Docker connectivity | |
run: | | |
# Test that the app can connect to Docker | |
timeout 10s ./target/release/docsee --help || true | |
- name: Run basic smoke tests | |
run: | | |
# Add any integration tests here | |
echo "Integration tests would go here" | |
# Example: Test with actual Docker commands | |
docker run --rm hello-world |