Skip to content

Commit baecd61

Browse files
authored
Merge pull request #1 from JohnBasrai/add-ci-workflow
Add GitHub Actions CI with format check, build, and test steps
2 parents 71d2041 + baf728a commit baecd61

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Install Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
components: rustfmt
25+
26+
- name: Cache Cargo dependencies
27+
uses: actions/cache@v4
28+
with:
29+
path: |
30+
~/.cargo/bin/
31+
~/.cargo/registry/index/
32+
~/.cargo/registry/cache/
33+
~/.cargo/git/db/
34+
target/
35+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-cargo-
38+
39+
- name: Check formatting
40+
run: cargo fmt --check
41+
42+
- name: Build release
43+
run: cargo build --release --quiet
44+
45+
- name: Run tests
46+
run: cargo test --release --quiet

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
2121
- Maintains identical behavior with improved structure and testability.
2222

2323
### Added
24+
- Added GitHub Actions CI with format check, build, and test steps
2425
- Added `process_actions` function to encapsulate business logic
2526
- Wrote unit tests using `anyhow::Result` and `ensure` for panic-free testing
27+
- Added `tracing` and `tracing-subscriber` crates for structured logging.
2628
- Added `parse_date` utility to safely parse ISO-8601 timestamps
2729
- Added README summary and improvements section
2830

0 commit comments

Comments
 (0)