Skip to content

Commit

Permalink
feat: implemented health check endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
irfanabduhu committed Dec 2, 2023
1 parent 3d183ab commit e9fd52a
Show file tree
Hide file tree
Showing 8 changed files with 2,000 additions and 2 deletions.
124 changes: 124 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
version: 2
jobs:
build-and-test:
docker:
- image: cimg/rust:1.74
environment:
# Fail the build if there are warnings
RUSTFLAGS: '-D warnings'
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
# If you have committed your Cargo.lock file to version control
# delete this step.
- run:
name: Calculate dependencies
command: cargo generate-lockfile
- restore_cache:
keys:
- v1-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Build all targets
command: cargo build
- save_cache:
paths:
- /home/circleci/.cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v1-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Run all tests
command: cargo test

security:
docker:
- image: cimg/rust:1.74
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- run:
name: Cache permission
command: |
sudo chown -R $(whoami):$(id -ng) /home/circleci/.cargo/bin/cargo
- restore_cache:
keys:
- v1-cargo-audit-{{ arch }}
- run:
name: Install dependency auditing tool
command: cargo install cargo-audit
- save_cache:
paths:
- /home/circleci/.cargo/bin/cargo
key: v1-cargo-audit-{{ arch }}
- run:
name: Check for known security issues in dependencies
command: cargo audit

format:
docker:
- image: cimg/rust:1.74
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- run:
name: Install formatter
command: rustup component add rustfmt
- run:
name: Formatting
command: cargo fmt --all -- --check

lint:
docker:
- image: cimg/rust:1.74
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- run:
name: Install Clippy
command: rustup component add clippy
- run:
name: Linting
command: cargo clippy -- -D warnings

coverage:
machine: true
steps:
- checkout
- run:
name: Coverage with docker
command: docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin cargo tarpaulin --ignore-tests

workflows:
version: 2
build-test:
jobs:
- build-and-test:
filters:
tags:
only: /.*/
- security:
filters:
tags:
only: /.*/
- format:
filters:
tags:
only: /.*/
- lint:
filters:
tags:
only: /.*/
- coverage:
filters:
tags:
only: /.*/

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
*.profraw
.raw.rs
Loading

0 comments on commit e9fd52a

Please sign in to comment.