Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 81 additions & 3 deletions .github/workflows/build-cicd.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,98 @@
name: build deploy to nomad
name: CI/CD

on:
push:
branches: ["**"]
pull_request:
branches: [main]

#Build
jobs:
# Lint job - runs first to catch formatting/style issues early
lint:
name: Lint (rustfmt & clippy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Check formatting
run: cargo fmt --all --check

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings

# Test job - runs after lint passes
test:
name: Test Suite
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Run tests
run: cargo test --all-features --verbose

# Build and push job - only runs after tests pass
build:
name: Build and Push Docker Images
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -96,4 +175,3 @@ jobs:
tags: cbaugus/rust_loadtest:${{ steps.docker_meta.outputs.TAG }}-Chainguard
provenance: true
push: true

18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Rust build artifacts
/target/
Cargo.lock

# IDE files
.idea/
.vscode/
*.swp
*.swo
*~

# OS files
.DS_Store
Thumbs.db

# Business documents (keep local only)
PRODUCT_DESIGN.md
BUSINESS_PLAN.md
Loading