Skip to content

docs: cleanup development files #5

docs: cleanup development files

docs: cleanup development files #5

Workflow file for this run

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
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
# Install cross for robust cross-compilation
cargo install cross --git https://github.com/cross-rs/cross
# Also install traditional tools as backup
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Configure linker (Linux ARM64)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
mkdir -p ~/.cargo
echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config.toml
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
- name: Build binary
shell: bash
run: |
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
# Use cross for ARM64 Linux builds
cross build --release --target ${{ matrix.target }}
else
# Use standard cargo for other targets
cargo build --release --target ${{ matrix.target }}
fi
- name: Prepare binary (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
cp target/${{ matrix.target }}/release/docsee ${{ matrix.name }}
chmod +x ${{ matrix.name }}
- name: Prepare binary (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Copy-Item "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