From 60d5920f85c7ab9c7c56e39dc0e32645b5e7e54b Mon Sep 17 00:00:00 2001
From: Mukesh Singh
Date: Sun, 6 Oct 2024 15:19:54 +0530
Subject: [PATCH] feat: circleci config updated
---
.circleci/config.yml | 54 +++++++++++++++++++++++++++++++-------------
README.md | 4 ++--
2 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 4175da6..49cd43e 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,26 +1,48 @@
-# Use the latest 2.1 version of CircleCI pipeline process engine.
-# See: https://circleci.com/docs/configuration-reference
version: 2.1
-# Define a job to be invoked later in a workflow.
-# See: https://circleci.com/docs/configuration-reference/#jobs
jobs:
- say-hello:
- # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub.
- # See: https://circleci.com/docs/configuration-reference/#executor-job
+ rust-checks:
docker:
- - image: cimg/base:stable
- # Add steps to the job
- # See: https://circleci.com/docs/configuration-reference/#steps
+ - image: cimg/rust:1.75 # Using CircleCI's Rust image
steps:
- checkout
+
+ # Cache dependencies to speed up builds
+ - restore_cache:
+ keys:
+ - cargo-cache-{{ checksum "Cargo.lock" }}
+ - cargo-cache-
+
+ # Install rustfmt and clippy
- run:
- name: "Say hello"
- command: "echo Hello, World!"
+ name: Install Rust Components
+ command: |
+ rustup component add rustfmt
+ rustup component add clippy
+
+ # Check formatting
+ - run:
+ name: Check Formatting
+ command: cargo fmt -- --check
+
+ # Run clippy
+ - run:
+ name: Run Clippy
+ command: cargo clippy -- -D warnings
+
+ # Build project
+ - run:
+ name: Build Project
+ command: cargo build --release
+
+ # Save cache
+ - save_cache:
+ key: cargo-cache-{{ checksum "Cargo.lock" }}
+ paths:
+ - ~/.cargo
+ - target
-# Orchestrate jobs using workflows
-# See: https://circleci.com/docs/configuration-reference/#workflows
workflows:
- say-hello-workflow:
+ rust-workflow:
jobs:
- - say-hello
+ - rust-checks
diff --git a/README.md b/README.md
index dcbbbf2..2142408 100644
--- a/README.md
+++ b/README.md
@@ -15,8 +15,8 @@
-
-
+
+