Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Favvie/StarkFinder into fea…
Browse files Browse the repository at this point in the history
…t/dropdown-swap-functionality
  • Loading branch information
Favvie committed Mar 2, 2025
2 parents 5ca2fd0 + ae5bc87 commit 96afd4a
Show file tree
Hide file tree
Showing 9 changed files with 1,309 additions and 15,306 deletions.
69 changes: 40 additions & 29 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI/CD Pipeline

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
check-contracts:
Expand All @@ -27,47 +27,53 @@ jobs:
- name: Add Scarb to PATH
run: echo "${HOME}/.local/share/scarb/bin" >> $GITHUB_PATH

# Cache Rust toolchain and dependencies
- name: Cache Rust
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target/
./contracts/target/
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
targets: wasm32-unknown-unknown
profile: minimal

- name: Cache snforge
- name: Cache forge
uses: actions/cache@v4
with:
path: ~/.cargo/bin/snforge
key: ${{ runner.os }}-snforge-0.33.0
- name: Install snforge
path: ~/.cargo/bin
key: ${{ runner.os }}-forge-${{ hashFiles('**/Cargo.lock') }}

- name: Install Starknet Foundry (snforge)
run: |
if ! command -v snforge &> /dev/null; then
cargo install --locked --git https://github.com/foundry-rs/starknet-foundry \
--tag v0.33.0 \
--bin snforge \
--features=rust-serde
if ! command -v forge &> /dev/null; then
git clone https://github.com/foundry-rs/starknet-foundry.git
cd starknet-foundry
cargo build --release
sudo cp target/release/snforge /usr/local/bin/forge
cd ..
rm -rf starknet-foundry
fi
echo "Installed snforge version: $(snforge --version)"
forge --version
- name: Install Universal Sierra Compiler
run: curl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh

- name: Install dependencies
run: scarb clean && scarb fetch
run: |
scarb clean
scarb fetch
- name: Build Starknet contracts
run: scarb build

- name: Run snforge tests
run: snforge test --workspace
- name: Run forge tests
run: forge test --workspace

nextjs-build-and-test:
runs-on: ubuntu-latest
Expand All @@ -81,19 +87,22 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './client/package-lock.json'
node-version: "20"
cache: "npm"
cache-dependency-path: "./client/package-lock.json"

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Setup pnpm
run: npm install -g pnpm

- name: Build
run: npm run build
env: # Proper indentation here
env:
NEXT_PUBLIC_API_URL: ${{ github.event_name == 'pull_request' && 'dummy-api-url' || secrets.NEXT_PUBLIC_API_URL }}
OPENAI_API_KEY: ${{ github.event_name == 'pull_request' && 'dummy-key' || secrets.OPENAI_API_KEY }}
BRIAN_API_KEY: ${{ github.event_name == 'pull_request' && 'dummy-key' || secrets.BRIAN_API_KEY }}
Expand All @@ -102,8 +111,8 @@ jobs:
uses: actions/cache@v4
with:
path: |
client/.next/cache
${{ github.workspace }}/client/.next/static
./client/.next/cache
./client/.next/static
key: ${{ runner.os }}-nextjs-${{ hashFiles('client/package-lock.json') }}-${{ hashFiles('client/**.[jt]sx?') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('client/package-lock.json') }}-
Expand All @@ -122,9 +131,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './client/package-lock.json'
node-version: "20"
cache: "npm"
cache-dependency-path: "./client/package-lock.json"

- name: Install dependencies
run: npm ci
Expand All @@ -135,3 +144,5 @@ jobs:
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
BRIAN_API_KEY: ${{ secrets.BRIAN_API_KEY }}


30 changes: 0 additions & 30 deletions .github/workflows/contributors.yml

This file was deleted.

Loading

0 comments on commit 96afd4a

Please sign in to comment.