Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 17 additions & 25 deletions .github/actions/setup-and-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ runs:
run: bash scripts/devenv/install-anchor.sh

- name: Cache Photon indexer
if: "!contains(inputs.skip-components, 'photon')"
id: cache-photon
uses: actions/cache@v4
with:
path: .local/cargo/bin/photon
key: ${{ runner.os }}-photon-${{ steps.versions.outputs.photon }}-${{ steps.versions.outputs.photon_commit }}

- name: Install Photon indexer
if: steps.cache-photon.outputs.cache-hit != 'true'
if: "!contains(inputs.skip-components, 'photon') && steps.cache-photon.outputs.cache-hit != 'true'"
shell: bash
run: bash scripts/devenv/install-photon.sh

Expand Down Expand Up @@ -177,34 +178,17 @@ runs:
mkdir -p ./target/deploy
cp ./third-party/solana-program-library/spl_noop.so ./target/deploy/spl_noop.so

- name: Cache Solana programs
id: cache-programs
- name: Cache target/deploy
id: cache-deploy
uses: actions/cache@v4
with:
path: |
target/deploy/*.so
target/idl
target/types
key: ${{ runner.os }}-programs-${{ hashFiles('programs/**/Cargo.toml', 'programs/**/Cargo.lock', 'programs/**/*.rs', 'program-libs/**/*.rs') }}
restore-keys: |
${{ runner.os }}-programs-

- name: Cache Solana program-tests
id: cache-program-tests
uses: actions/cache@v4
with:
path: |
target/deploy/create_address_test_program.so
target/deploy/sdk_anchor_test.so
target/deploy/sdk-compressible-test.so
target/deploy/csdk_anchor_derived_test.so
target/deploy/csdk_anchor_full_derived_test.so
key: ${{ runner.os }}-program-tests-${{ hashFiles('program-tests/**/Cargo.toml', 'program-tests/**/Cargo.lock', 'program-tests/**/*.rs', 'test-programs/**/Cargo.toml', 'test-programs/**/*.rs', 'sdk-tests/**/Cargo.toml', 'sdk-tests/**/*.rs') }}
path: target/deploy
key: ${{ runner.os }}-deploy-${{ hashFiles('programs/**/*.rs', 'program-libs/**/*.rs', 'program-tests/**/*.rs', 'test-programs/**/*.rs', 'sdk-tests/**/*.rs', '**/Cargo.toml', '**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-program-tests-
${{ runner.os }}-deploy-

- name: Build Rust programs
if: steps.cache-programs.outputs.cache-hit != 'true'
if: steps.cache-deploy.outputs.cache-hit != 'true'
shell: bash
run: |
echo "Building Rust programs..."
Expand All @@ -214,7 +198,7 @@ runs:
fi

- name: Build Rust program-tests
if: steps.cache-program-tests.outputs.cache-hit != 'true'
if: steps.cache-deploy.outputs.cache-hit != 'true'
shell: bash
run: |
echo "Building Rust program-tests..."
Expand All @@ -223,6 +207,14 @@ runs:
npx nx build @lightprotocol/program-tests --verbose
fi

- name: Save deploy cache
# Save cache even on failure to speed up retries
if: steps.cache-deploy.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: target/deploy
key: ${{ runner.os }}-deploy-${{ hashFiles('programs/**/*.rs', 'program-libs/**/*.rs', 'program-tests/**/*.rs', 'test-programs/**/*.rs', 'sdk-tests/**/*.rs', '**/Cargo.toml', '**/Cargo.lock') }}

- name: Check for git changes
shell: bash
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

jobs:
actionlint:
if: false # Temporarily disabled for LiteSVM testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
jobs:
cli-v1:
name: cli-v1
if: github.event.pull_request.draft == false
if: false # Temporarily disabled for LiteSVM testing
runs-on: ubuntu-latest

services:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
jobs:
cli-v2:
name: cli-v2
if: github.event.pull_request.draft == false
if: false # Temporarily disabled for LiteSVM testing
runs-on: ubuntu-latest

services:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/forester-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ env:

jobs:
test:
if: false # Temporarily disabled for LiteSVM testing
name: Forester e2e test
runs-on: warp-ubuntu-latest-x64-4x
timeout-minutes: 60
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/js-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ concurrency:
jobs:
stateless-js-v2:
name: stateless-js-v2
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

services:
Expand All @@ -46,7 +45,7 @@ jobs:
- name: Setup and build
uses: ./.github/actions/setup-and-build
with:
skip-components: "redis,disk-cleanup,go"
skip-components: "redis,disk-cleanup,go,photon"
cache-key: "js"

- name: Build stateless.js with V2
Expand All @@ -63,7 +62,27 @@ jobs:
run: |
npx nx build @lightprotocol/zk-compression-cli

- name: Build program-test
run: |
cd js/program-test
pnpm build:v2

- name: Start prover server
run: |
source ./scripts/devenv.sh
light start-prover &
sleep 5

- name: Run program-test tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/program-test

- name: Run stateless.js tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running stateless.js tests with retry logic (max 2 attempts)..."
attempt=1
Expand All @@ -80,6 +99,8 @@ jobs:
echo "Tests passed on attempt $attempt"

- name: Run compressed-token unit tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running compressed-token unit tests with retry logic (max 2 attempts)..."
attempt=1
Expand All @@ -96,6 +117,8 @@ jobs:
echo "Tests passed on attempt $attempt"

- name: Run compressed-token ctoken tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running compressed-token ctoken tests with retry logic (max 2 attempts)..."
attempt=1
Expand All @@ -113,6 +136,8 @@ jobs:
echo "Tests passed on attempt $attempt"

- name: Run sdk-anchor-test TypeScript tests with V2
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
npx nx build @lightprotocol/sdk-anchor-test
cd sdk-tests/sdk-anchor-test
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ concurrency:
jobs:
stateless-js-v1:
name: stateless-js-v1
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

services:
Expand All @@ -46,7 +45,7 @@ jobs:
- name: Setup and build
uses: ./.github/actions/setup-and-build
with:
skip-components: "redis,disk-cleanup,go"
skip-components: "redis,disk-cleanup,go,photon"
cache-key: "js"

- name: Build stateless.js with V1
Expand All @@ -63,7 +62,27 @@ jobs:
run: |
npx nx build @lightprotocol/zk-compression-cli

- name: Build program-test
run: |
cd js/program-test
pnpm build:v1

- name: Start prover server
run: |
source ./scripts/devenv.sh
light start-prover &
sleep 5

- name: Run program-test tests with V1
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/program-test

- name: Run stateless.js tests with V1
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running stateless.js tests with retry logic (max 2 attempts)..."
attempt=1
Expand All @@ -80,6 +99,8 @@ jobs:
echo "Tests passed on attempt $attempt"

- name: Run compressed-token tests with V1
env:
NODE_OPTIONS: "--max-old-space-size=1024"
run: |
echo "Running compressed-token tests with retry logic (max 2 attempts)..."
attempt=1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
jobs:
lint:
name: lint
if: github.event.pull_request.draft == false
if: false # Temporarily disabled for LiteSVM testing
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:

jobs:
main:
if: false # Temporarily disabled for LiteSVM testing
name: Validate PR title
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:
jobs:
system-programs:
name: system-programs
if: github.event.pull_request.draft == false
if: false # Temporarily disabled for LiteSVM testing
runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down
4 changes: 3 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
},
"devDependencies": {
"@eslint/js": "9.36.0",
"@lightprotocol/program-test": "workspace:*",
"@oclif/test": "^4.1.14",
"@solana/spl-token": "^0.3.11",
"@types/bn.js": "^5.1.5",
Expand Down Expand Up @@ -148,7 +149,8 @@
"build-ci": {
"dependsOn": [
"@lightprotocol/stateless.js:build-ci",
"@lightprotocol/compressed-token:build-ci"
"@lightprotocol/compressed-token:build-ci",
"@lightprotocol/program-test:build"
],
"inputs": [
"{workspaceRoot}/js",
Expand Down
2 changes: 1 addition & 1 deletion cli/test/commands/approve-and-mint-to/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { initTestEnvIfNeeded } from "../../../src/utils/initTestEnv";
import { defaultSolanaWalletKeypair } from "../../../src";
import { Keypair } from "@solana/web3.js";
import { createTestSplMint, requestAirdrop } from "../../helpers/helpers";
import { getTestRpc } from "@lightprotocol/stateless.js";
import { getTestRpc } from "@lightprotocol/program-test";
import { WasmFactory } from "@lightprotocol/hasher.rs";

describe("mint-to", () => {
Expand Down
2 changes: 1 addition & 1 deletion cli/test/commands/create-token-pool/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { initTestEnvIfNeeded } from "../../../src/utils/initTestEnv";
import { defaultSolanaWalletKeypair } from "../../../src";
import { createTestSplMint, requestAirdrop } from "../../helpers/helpers";
import { Keypair } from "@solana/web3.js";
import { getTestRpc } from "@lightprotocol/stateless.js";
import { getTestRpc } from "@lightprotocol/program-test";
import { WasmFactory } from "@lightprotocol/hasher.rs";

describe("create-mint", () => {
Expand Down
2 changes: 1 addition & 1 deletion cli/test/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
buildAndSignTx,
confirmTx,
dedupeSigner,
getTestRpc,
sendAndConfirmTx,
} from "@lightprotocol/stateless.js";
import { getTestRpc } from "@lightprotocol/program-test";
import { createMint, mintTo } from "@lightprotocol/compressed-token";
import {
MINT_SIZE,
Expand Down
30 changes: 21 additions & 9 deletions js/compressed-token/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@coral-xyz/anchor": "^0.29.0",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@eslint/js": "9.36.0",
"@lightprotocol/hasher.rs": "0.2.1",
"@lightprotocol/program-test": "workspace:*",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
Expand Down Expand Up @@ -94,6 +94,22 @@
"test:v1": "pnpm build:v1 && LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V1 pnpm test:e2e:legacy:all",
"test:v2": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:ctoken:all",
"test:v2:ctoken": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:ctoken:all",
"test:program-test": "vitest run tests/program-test --reporter=verbose",
"test:program-test:v1": "LIGHT_PROTOCOL_VERSION=V1 pnpm test:program-test",
"test:program-test:v2": "LIGHT_PROTOCOL_VERSION=V2 pnpm test:program-test",
"test:program-test:approve-and-mint-to": "vitest run tests/program-test/approve-and-mint-to.test.ts --reporter=verbose --bail=1",
"test:program-test:compress-spl-token-account": "vitest run tests/program-test/compress-spl-token-account.test.ts --reporter=verbose",
"test:program-test:compress": "vitest run tests/program-test/compress.test.ts --reporter=verbose",
"test:program-test:create-mint": "vitest run tests/program-test/create-mint.test.ts --reporter=verbose",
"test:program-test:create-token-pool": "vitest run tests/program-test/create-token-pool.test.ts --reporter=verbose",
"test:program-test:decompress-delegated": "vitest run tests/program-test/decompress-delegated.test.ts --reporter=verbose",
"test:program-test:decompress": "vitest run tests/program-test/decompress.test.ts --reporter=verbose",
"test:program-test:delegate": "vitest run tests/program-test/delegate.test.ts --reporter=verbose --bail=1",
"test:program-test:merge-token-accounts": "vitest run tests/program-test/merge-token-accounts.test.ts --reporter=verbose",
"test:program-test:mint-to": "vitest run tests/program-test/mint-to.test.ts --reporter=verbose --bail=1",
"test:program-test:multi-pool": "vitest run tests/program-test/multi-pool.test.ts --reporter=verbose",
"test:program-test:transfer-delegated": "vitest run tests/program-test/transfer-delegated.test.ts --reporter=verbose --bail=1",
"test:program-test:transfer": "vitest run tests/program-test/transfer.test.ts --reporter=verbose --bail=1",
"test-all": "vitest run",
"test:unit:all": "EXCLUDE_E2E=true vitest run",
"test:unit:all:v1": "LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit --reporter=verbose",
Expand All @@ -112,18 +128,13 @@
"test:e2e:update-metadata": "pnpm test-validator && vitest run tests/e2e/update-metadata.test.ts --reporter=verbose",
"test:e2e:layout": "vitest run tests/e2e/layout.test.ts --reporter=verbose --bail=1",
"test:e2e:select-accounts": "vitest run tests/e2e/select-accounts.test.ts --reporter=verbose",
"test:e2e:create-token-pool": "pnpm test-validator && vitest run tests/e2e/create-token-pool.test.ts",
"test:e2e:mint-to": "pnpm test-validator && vitest run tests/e2e/mint-to.test.ts --reporter=verbose --bail=1",
"test:e2e:approve-and-mint-to": "pnpm test-validator && vitest run tests/e2e/approve-and-mint-to.test.ts --reporter=verbose --bail=1",
"test:e2e:merge-token-accounts": "pnpm test-validator && vitest run tests/e2e/merge-token-accounts.test.ts --reporter=verbose",
"test:e2e:transfer": "pnpm test-validator && vitest run tests/e2e/transfer.test.ts --reporter=verbose --bail=1",
"test:e2e:delegate": "pnpm test-validator && vitest run tests/e2e/delegate.test.ts --reporter=verbose --bail=1",
"test:e2e:transfer-delegated": "pnpm test-validator && vitest run tests/e2e/transfer-delegated.test.ts --reporter=verbose --bail=1",
"test:e2e:compress": "pnpm test-validator && vitest run tests/e2e/compress.test.ts --reporter=verbose",
"test:e2e:compress-spl-token-account": "pnpm test-validator && vitest run tests/e2e/compress-spl-token-account.test.ts --reporter=verbose",
"test:e2e:decompress": "pnpm test-validator && vitest run tests/e2e/decompress.test.ts --reporter=verbose",
"test:e2e:decompress-delegated": "pnpm test-validator && vitest run tests/e2e/decompress-delegated.test.ts --reporter=verbose",
"test:e2e:decompress2": "pnpm test-validator && vitest run tests/e2e/decompress2.test.ts --reporter=verbose",
"test:e2e:merge-token-accounts": "pnpm test-validator && vitest run tests/e2e/merge-token-accounts.test.ts --reporter=verbose",
"test:e2e:mint-to": "pnpm test-validator && vitest run tests/e2e/mint-to.test.ts --reporter=verbose --bail=1",
"test:e2e:rpc-token-interop": "pnpm test-validator && vitest run tests/e2e/rpc-token-interop.test.ts --reporter=verbose",
"test:e2e:rpc-multi-trees": "pnpm test-validator && vitest run tests/e2e/rpc-multi-trees.test.ts --reporter=verbose",
"test:e2e:multi-pool": "pnpm test-validator && vitest run tests/e2e/multi-pool.test.ts --reporter=verbose",
Expand Down Expand Up @@ -173,7 +184,8 @@
},
"test-ci": {
"dependsOn": [
"@lightprotocol/stateless.js:test-ci"
"@lightprotocol/stateless.js:test-ci",
"@lightprotocol/program-test:build"
]
}
}
Expand Down
Loading
Loading