From 9feed008718f897e383888274ed9594ce0558664 Mon Sep 17 00:00:00 2001 From: "John S. Basrai" Date: Fri, 27 Jun 2025 14:36:42 -0700 Subject: [PATCH 1/2] Add GitHub Actions CI with format check, build, and test steps --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9d66908 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Cache Cargo dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Install cargo-lambda + run: cargo install cargo-lambda + + - name: Check formatting + run: cargo fmt --check + + - name: Build release + run: cargo build --release --quiet + + - name: Run tests + run: cargo test --release --quiet diff --git a/CHANGELOG.md b/CHANGELOG.md index f958094..4945f1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,10 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and - Maintains identical behavior with improved structure and testability. ### Added +- Added GitHub Actions CI with format check, build, and test steps - Added `process_actions` function to encapsulate business logic - Wrote unit tests using `anyhow::Result` and `ensure` for panic-free testing +- Added `tracing` and `tracing-subscriber` crates for structured logging. - Added `parse_date` utility to safely parse ISO-8601 timestamps - Added README summary and improvements section From baf728a02a009856d867e76f61aa3adefbaff128 Mon Sep 17 00:00:00 2001 From: "John S. Basrai" Date: Fri, 27 Jun 2025 14:41:30 -0700 Subject: [PATCH 2/2] Remove installation of cargo lambda in CI workflow, not needed yet --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d66908..6df8964 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,9 +36,6 @@ jobs: restore-keys: | ${{ runner.os }}-cargo- - - name: Install cargo-lambda - run: cargo install cargo-lambda - - name: Check formatting run: cargo fmt --check