Skip to content

Commit

Permalink
feat: circleci config updated
Browse files Browse the repository at this point in the history
  • Loading branch information
CA-MKSingh committed Oct 6, 2024
1 parent ec9ea7c commit 60d5920
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
54 changes: 38 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<a href="https://docs.rs/rust-shield">
<img alt="crate-docs" src="https://img.shields.io/badge/docs-docs.rs-orange?logo=rust">
</a>
<a href="https://circleci.com/gh/AutomationTank/shield">
<img alt="build status" src="https://circleci.com/gh/AutomationTank/shield.svg?style=shield"/>
<a href="[[![CircleCI](https://dl.circleci.com/status-badge/img/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/trunk.svg?style=svg)]()](https://dl.circleci.com/status-badge/redirect/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/trunk)">
<img alt="build status" src="https://dl.circleci.com/status-badge/img/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/trunk.svg?style=svg"/>
</a>
</p>
<p align="center">
Expand Down

0 comments on commit 60d5920

Please sign in to comment.