Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1b6df5d
bump version to git dep
ananas-block Jan 30, 2026
0556ff5
wip
sergeytimoshin Feb 2, 2026
f4a5cab
test with photon
sergeytimoshin Feb 2, 2026
a2107d7
fix lint errors
sergeytimoshin Feb 2, 2026
f46c0f1
chore: update Rust version to 1.93 in CI configuration
sergeytimoshin Feb 2, 2026
db23f71
feat: add Node.js and pnpm setup, cache light-protocol, and build steps
sergeytimoshin Feb 2, 2026
8eeff64
feat: add caching and installation steps for Solana CLI in CI workflow
sergeytimoshin Feb 2, 2026
c33c597
feat: install light CLI globally for better accessibility in CI workflow
sergeytimoshin Feb 2, 2026
046f64a
revert to be closer to raydium
sergeytimoshin Feb 2, 2026
bcabb55
revert to be closer to raydium
sergeytimoshin Feb 2, 2026
d6a9a15
cleanup
sergeytimoshin Feb 2, 2026
4536b00
relax lint rules
sergeytimoshin Feb 2, 2026
922d27c
Update programs/cp-swap/src/states/pool.rs
sergeytimoshin Feb 2, 2026
180eba1
Update .gitignore to include .surfpool
sergeytimoshin Feb 2, 2026
b395012
Update light-protocol dependencies to latest revision
sergeytimoshin Feb 2, 2026
9c167ee
remove obsolete start-validator script
sergeytimoshin Feb 2, 2026
d1cdd3d
update dependencies
sergeytimoshin Feb 9, 2026
5651ec6
Add CI setup action for Rust, Solana, Node.js, and pnpm
sergeytimoshin Feb 9, 2026
954599f
update clippy
sergeytimoshin Feb 9, 2026
a412ccd
Update CI configuration to include 'justfile' in paths and cache key
sergeytimoshin Feb 9, 2026
cd69276
Update LIGHT_PROTOCOL_COMMIT to the latest version
sergeytimoshin Feb 9, 2026
d48e542
Update light-protocol dependencies to the latest revision and adjust …
sergeytimoshin Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[net]
git-fetch-with-cli = true
65 changes: 65 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Setup CI
description: Common CI setup — just, Rust, git HTTPS, and optionally Solana, Node, pnpm

inputs:
rust-version:
description: Rust toolchain version
required: true
components:
description: Rust components (e.g. "rustfmt, clippy")
default: ""
solana-version:
description: Solana CLI version (skip if empty)
default: ""
node-version:
description: Node.js version (skip if empty)
default: ""
pnpm-version:
description: pnpm version (skip if empty)
default: ""

runs:
using: composite
steps:
- name: Install just
uses: extractions/setup-just@v2

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ inputs.rust-version }}
components: ${{ inputs.components }}

- name: Configure git to use HTTPS instead of SSH
shell: bash
run: git config --global url."https://github.com/".insteadOf "git@github.com:"

- name: Cache Solana CLI
if: inputs.solana-version != ''
id: cache-solana
uses: actions/cache@v4
with:
path: ~/.local/share/solana/install
key: ${{ runner.os }}-solana-${{ inputs.solana-version }}

- name: Install Solana CLI
if: inputs.solana-version != '' && steps.cache-solana.outputs.cache-hit != 'true'
shell: bash
run: sh -c "$(curl -sSfL https://release.anza.xyz/v${{ inputs.solana-version }}/install)"

- name: Add Solana to PATH
if: inputs.solana-version != ''
shell: bash
run: echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH

- name: Setup Node.js
if: inputs.node-version != ''
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Setup pnpm
if: inputs.pnpm-version != ''
uses: pnpm/action-setup@v4
with:
version: ${{ inputs.pnpm-version }}
236 changes: 236 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
name: CI

on:
push:
branches: [main, master]
paths:
- "programs/**"
- "Cargo.toml"
- "Cargo.lock"
- "justfile"
- ".github/**"
pull_request:
branches: [main, master]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "programs/**"
- "Cargo.toml"
- "Cargo.lock"
- "justfile"
- ".github/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
# Light protocol commit that cp-swap-reference depends on
LIGHT_PROTOCOL_COMMIT: "9edc09306e08ed81740b0c06ec5edae27830735a"
# Versions from light-protocol at that commit
SOLANA_VERSION: "2.2.15"
RUST_VERSION: "1.93"
NODE_VERSION: "22"
PNPM_VERSION: "9.15.4"
PHOTON_VERSION: "0.51.2"
PHOTON_COMMIT: "2e32a4e48f95d68a4d99b9384a763f4a4157fe85"
SBF_OUT_DIR: target/deploy

jobs:
lint:
name: Lint
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
rust-version: ${{ env.RUST_VERSION }}
components: rustfmt, clippy

- name: Run lint
run: just lint

build:
name: Build
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
rust-version: ${{ env.RUST_VERSION }}
solana-version: ${{ env.SOLANA_VERSION }}

- name: Cache program build
id: cache-program
uses: actions/cache@v4
with:
path: target/deploy/*.so
key: ${{ runner.os }}-program-${{ hashFiles('programs/**/*.rs', 'programs/**/Cargo.toml', 'Cargo.lock', 'justfile') }}

- name: Build program
if: steps.cache-program.outputs.cache-hit != 'true'
run: just build

- name: Upload program artifact
uses: actions/upload-artifact@v4
with:
name: program-so
path: target/deploy/*.so
retention-days: 1

test-local:
name: Local Tests
needs: build
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
rust-version: ${{ env.RUST_VERSION }}
solana-version: ${{ env.SOLANA_VERSION }}
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}

- name: Cache light-protocol
id: cache-light-protocol
uses: actions/cache@v4
with:
path: |
light-protocol
light-protocol/node_modules
light-protocol/target/deploy/*.so
key: ${{ runner.os }}-light-protocol-${{ env.LIGHT_PROTOCOL_COMMIT }}

- name: Clone and build light-protocol
if: steps.cache-light-protocol.outputs.cache-hit != 'true'
run: |
git clone https://github.com/Lightprotocol/light-protocol.git
cd light-protocol
git checkout ${{ env.LIGHT_PROTOCOL_COMMIT }}

just install
just programs build
just cli build

- name: Install light CLI globally
run: |
# Install the CLI globally so find_light_bin() can discover it
cd light-protocol/cli && npm install -g .
# Verify the CLI is accessible
which light

- name: Download program artifact
uses: actions/download-artifact@v4
with:
name: program-so
path: target/deploy

- name: Run local tests
run: just test-local

test-integration:
name: Integration Tests
needs: build
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 45

services:
redis:
image: redis:8.0.1
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
REDIS_URL: redis://localhost:6379

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
rust-version: ${{ env.RUST_VERSION }}
solana-version: ${{ env.SOLANA_VERSION }}
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}

- name: Cache Photon
id: cache-photon
uses: actions/cache@v4
with:
path: ~/.cargo/bin/photon
key: ${{ runner.os }}-photon-${{ env.PHOTON_VERSION }}-${{ env.PHOTON_COMMIT }}

- name: Install Photon from git
if: steps.cache-photon.outputs.cache-hit != 'true'
run: |
echo "Installing Photon ${{ env.PHOTON_VERSION }} (commit ${{ env.PHOTON_COMMIT }})..."
RUSTFLAGS="-A dead-code" cargo install --git https://github.com/helius-labs/photon.git --rev ${{ env.PHOTON_COMMIT }} --locked --force

- name: Cache light-protocol
id: cache-light-protocol
uses: actions/cache@v4
with:
path: |
light-protocol
light-protocol/node_modules
light-protocol/target/deploy/*.so
key: ${{ runner.os }}-light-protocol-${{ env.LIGHT_PROTOCOL_COMMIT }}

- name: Clone and build light-protocol
if: steps.cache-light-protocol.outputs.cache-hit != 'true'
run: |
git clone https://github.com/Lightprotocol/light-protocol.git
cd light-protocol
git checkout ${{ env.LIGHT_PROTOCOL_COMMIT }}

# Use light-protocol's justfile commands
just install
just programs build
just cli build

- name: Install light CLI globally
run: |
# Install the CLI globally so find_light_bin() can discover it
cd light-protocol/cli && npm install -g .
# Verify the CLI is accessible
which light

- name: Download program artifact
uses: actions/download-artifact@v4
with:
name: program-so
path: target/deploy

- name: Generate Solana keypair
run: |
mkdir -p ~/.config/solana
solana-keygen new --no-bip39-passphrase -o ~/.config/solana/id.json

- name: Start light test-validator
run: |
cd light-protocol
pnpm --filter=@lightprotocol/zk-compression-cli test-validator &
# Wait for validator to be ready
sleep 45
solana cluster-version || (echo "Validator not ready" && exit 1)

- name: Run integration tests
run: just test-integration

- name: Display logs on failure
if: failure()
run: |
echo "=== Displaying test-ledger logs ==="
find . -path "*/test-ledger/*.log" -type f -exec echo "=== {} ===" \; -exec tail -100 {} \; || echo "No logs found"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

.surfpool
.anchor
.DS_Store
target
Expand Down
Loading