Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Binary file removed .DS_Store
Binary file not shown.
133 changes: 133 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Setup Environment
description: Setup Rust, Solana CLI, Node.js, and Light Protocol tools for testing

inputs:
cache-workspaces:
description: "Rust workspaces to cache (format: 'path -> target')"
required: false
default: |
. -> target
examples/rust -> target
rust-toolchain:
description: "Rust toolchain version"
required: false
default: "1.90.0"
solana-cli-version:
description: "Solana CLI version"
required: false
default: "2.3.11"
node-version:
description: "Node.js version to install"
required: false
default: "20"
install-light-cli:
description: "Install Light Protocol CLI"
required: false
default: "true"
install-pnpm:
description: "Install pnpm package manager"
required: false
default: "false"
pnpm-version:
description: "pnpm version to install"
required: false
default: "9.10.0"
photon-indexer:
description: "Install Photon indexer (required for compression tests)"
required: false
default: "false"

runs:
using: composite
steps:
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ inputs.rust-toolchain }}
components: rustfmt, clippy
cache-workspaces: ${{ inputs.cache-workspaces }}

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

- name: Cache Solana CLI tools
uses: actions/cache@v4
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-cli-${{ runner.os }}-${{ inputs.solana-cli-version }}
restore-keys: |
solana-cli-${{ runner.os }}-

- name: Install Solana CLI
shell: bash
run: |
sh -c "$(curl -sSfL https://release.anza.xyz/v${{ inputs.solana-cli-version }}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH

- name: Cache Light CLI
if: inputs.install-light-cli == 'true'
uses: actions/cache@v4
with:
path: |
~/.npm
~/.cache/npm
key: light-cli-${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/pnpm-lock.yaml') }}
restore-keys: |
light-cli-${{ runner.os }}-

- name: Install Light CLI
if: inputs.install-light-cli == 'true'
shell: bash
run: npm install -g @lightprotocol/zk-compression-cli@alpha

- name: Install pnpm
if: inputs.install-pnpm == 'true'
uses: pnpm/action-setup@v2
with:
version: ${{ inputs.pnpm-version }}

- name: Setup pnpm cache
if: inputs.install-pnpm == 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: "pnpm"

- name: Cache Photon indexer
if: inputs.photon-indexer == 'true'
uses: actions/cache@v4
with:
path: ~/.cargo/bin/photon
key: photon-${{ runner.os }}-1a785036de52896b68d06413e3b0231122d6aa4a

- name: Install Photon indexer
if: inputs.photon-indexer == 'true'
shell: bash
env:
RUSTFLAGS: "-A dead-code"
run: |
if [ ! -f ~/.cargo/bin/photon ]; then
cargo install --git https://github.com/lightprotocol/photon.git --rev 1a785036de52896b68d06413e3b0231122d6aa4a --locked
fi

- name: Generate keypair
shell: bash
run: solana-keygen new --no-bip39-passphrase

- name: Display versions
shell: bash
run: |
rustc --version
cargo --version
solana --version
node --version
if [ "${{ inputs.install-light-cli }}" == "true" ]; then
light --version
fi
if [ "${{ inputs.install-pnpm }}" == "true" ]; then
pnpm --version
fi
84 changes: 84 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Examples

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
branches:
- master

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

env:
SOLANA_CLI_VERSION: "2.3.11"
RUST_TOOLCHAIN: "1.90.0"

jobs:
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup
with:
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
node-version: "20"
install-light-cli: "true"
install-pnpm: "true"
pnpm-version: "9.10.0"
photon-indexer: "true"

- name: Build Solana program
run: make build-sbf

- name: Install and build root dependencies
run: make install && make build

- name: Test TypeScript client
working-directory: clients/typescript
run: pnpm test

- name: Start test validator
run: |
light test-validator \
--sbf-program 22zoJMtdu4tQc2PzL74ZUT7FrwgB1Udec8DdW4yw4BdG target/deploy/solana_attestation_service.so \
&
echo "VALIDATOR_PID=$!" >> $GITHUB_ENV

- name: Wait for validator to be ready
run: sleep 20

- name: Fund default wallet
run: solana airdrop 1 -ul

- name: Run standard-demo
working-directory: examples/rust/attestation-flow-guide/standard-demo
run: |
cargo run
timeout-minutes: 5

- name: Run tokenization-demo
working-directory: examples/rust/attestation-flow-guide/tokenization-demo
run: |
cargo run
timeout-minutes: 5

- name: Run compression-demo
working-directory: examples/rust/attestation-flow-guide/compression-demo
run: cargo run

- name: Run TypeScript examples
working-directory: examples/typescript/attestation-flow-guides
run: |
pnpm gill:standard
pnpm gill:tokenized
pnpm gill:compressed
pnpm kit:standard
pnpm kit:tokenized
pnpm kit:compressed
36 changes: 36 additions & 0 deletions .github/workflows/rust-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Rust Lint

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
branches:
- master

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

env:
RUST_TOOLCHAIN: "1.90.0"
SOLANA_CLI_VERSION: "2.3.11"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup
with:
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
node-version: "20"
install-light-cli: "false"
install-pnpm: "false"

- name: Run lint
run: make lint
35 changes: 35 additions & 0 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Rust Integration Tests

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
branches:
- master

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

env:
SOLANA_CLI_VERSION: "2.3.11"
RUST_TOOLCHAIN: "1.90.0"

jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup
with:
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
node-version: "20"
install-light-cli: "true"

- name: Build Solana program and run all tests
run: make test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/target
*keypair.json
node_modules
dist/
dist/
.claude
test-ledger
.DS_Store
Loading