diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6df8964 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +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: 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