Skip to content

Commit

Permalink
circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaele-oplabs committed Jan 31, 2025
1 parent 320a423 commit 71d7938
Showing 1 changed file with 8 additions and 38 deletions.
46 changes: 8 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,10 @@
version: 2.1


executors:
default:
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.47.3


# Define reusable commands
commands:
install_rust_toolchain:
steps:
- run:
name: Install Rust nightly
command: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
source "$HOME/.cargo/env"
install_foundry:
steps:
- run:
name: Install Foundry
command: |
curl -L https://foundry.paradigm.xyz | bash
echo 'export PATH="$PATH:/home/circleci/.foundry/bin"' >> $BASH_ENV
source $BASH_ENV
foundryup --version nightly
install_just:
steps:
- run:
name: Install just
command: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
jobs:
init:
executor: default
Expand All @@ -44,25 +15,30 @@ jobs:
- run:
name: Generate testdata
command: just testdata
# Persist workspace for other jobs
- persist_to_workspace:
root: .
paths:
- .


cargo-tests:
docker:
- image: cimg/rust:1.75
environment:
CARGO_TERM_COLOR: always
LIBCLANG_PATH: /usr/lib/llvm-14/lib
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- rust-cache-v1-{{ checksum "Cargo.lock" }}
- rust-cache-v1-
# Install required dependencies
- run:
name: Install Dependencies
command: |
sudo apt-get update
sudo apt-get install -y llvm-14 libclang-14-dev clang-14 pkg-config libssl-dev
- run:
name: Run fuzz tests
command: cargo run --release -- -m 100 -t 4 --diff-count 50000
Expand All @@ -82,30 +58,24 @@ jobs:
paths:
- ~/.cargo
- target


foundry-check:
executor: default
environment:
FOUNDRY_PROFILE: ci
steps:
- checkout

# Check formatting
- run:
name: Check formatting
command: |
forge fmt --check
# Run Forge tests (equivalent to the GitHub Action's forge test step)
- run:
name: Run Forge tests
command: |
forge test -vvv
workflows:
version: 2

sol-test-workflow:
jobs:
- foundry-check
Expand All @@ -115,4 +85,4 @@ workflows:
- init
- cargo-tests:
requires:
- init
- init

0 comments on commit 71d7938

Please sign in to comment.