Skip to content
Closed
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
12 changes: 11 additions & 1 deletion .github/actions/setup-and-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Setup and build
description: Checkout sources, install dependencies, build and prepare for tests

inputs:
components:
description: 'Comma-separated list of components to install (e.g., "node,pnpm,solana,anchor,jq,dependencies"). If not specified, all components are installed.'
required: false
default: ""

runs:
using: "composite"
steps:
Expand Down Expand Up @@ -34,7 +40,11 @@ runs:
if: steps.restore-local-cache.outputs.cache-hit != 'true'
shell: bash
run: |
./scripts/install.sh
if [ -n "${{ inputs.components }}" ]; then
./scripts/install.sh --components "${{ inputs.components }}"
else
./scripts/install.sh
fi

- name: Set local environment
shell: bash
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/cli-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
on:
push:
branches:
- main
pull_request:
branches:
- "*"
types:
- opened
- synchronize
- reopened
- ready_for_review

name: cli-tests-v1

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

jobs:
cli-v1:
name: cli-v1
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

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:
LIGHT_PROTOCOL_VERSION: V1
REDIS_URL: redis://localhost:6379
CI: true

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Cache nx
uses: actions/cache@v4
with:
path: |
.nx/cache
node_modules/.cache/nx
js/stateless.js/node_modules/.cache/nx
js/compressed-token/node_modules/.cache/nx
cli/node_modules/.cache/nx
key: nx-cli-v1-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-${{ github.sha }}
restore-keys: |
nx-cli-v1-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-
nx-cli-v1-${{ runner.os }}-

- name: Setup and build
uses: ./.github/actions/setup-and-build

- name: Build stateless.js with V1
run: |
source ./scripts/devenv.sh
cd js/stateless.js
pnpm build:v1

- name: Build compressed-token with V1
run: |
source ./scripts/devenv.sh
cd js/compressed-token
pnpm build:v1

- name: Build CLI with V1
run: |
source ./scripts/devenv.sh
npx nx build @lightprotocol/zk-compression-cli

- name: Run CLI tests with V1
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/zk-compression-cli

- name: Display prover logs on failure
if: failure()
run: |
echo "=== Displaying prover logs ==="
find cli/test-ledger -name "*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found"
89 changes: 89 additions & 0 deletions .github/workflows/cli-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
on:
push:
branches:
- main
pull_request:
branches:
- "*"
types:
- opened
- synchronize
- reopened
- ready_for_review

name: cli-tests-v2

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

jobs:
cli-v2:
name: cli-v2
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

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:
LIGHT_PROTOCOL_VERSION: V2
REDIS_URL: redis://localhost:6379
CI: true

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Cache nx
uses: actions/cache@v4
with:
path: |
.nx/cache
node_modules/.cache/nx
js/stateless.js/node_modules/.cache/nx
js/compressed-token/node_modules/.cache/nx
cli/node_modules/.cache/nx
key: nx-cli-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-${{ github.sha }}
restore-keys: |
nx-cli-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-
nx-cli-v2-${{ runner.os }}-

- name: Setup and build
uses: ./.github/actions/setup-and-build

- name: Build stateless.js with V2
run: |
source ./scripts/devenv.sh
cd js/stateless.js
pnpm build:v2

- name: Build compressed-token with V2
run: |
source ./scripts/devenv.sh
cd js/compressed-token
pnpm build:v2

- name: Build CLI with V2
run: |
source ./scripts/devenv.sh
npx nx build @lightprotocol/zk-compression-cli

- name: Run CLI tests with V2
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/zk-compression-cli

- name: Display prover logs on failure
if: failure()
run: |
echo "=== Displaying prover logs ==="
find . -path "*/test-ledger/*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found"
94 changes: 94 additions & 0 deletions .github/workflows/js-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
on:
push:
branches:
- main
pull_request:
branches:
- "*"
types:
- opened
- synchronize
- reopened
- ready_for_review

name: js-tests-v2

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

jobs:
stateless-js-v2:
name: stateless-js-v2
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

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:
LIGHT_PROTOCOL_VERSION: V2
REDIS_URL: redis://localhost:6379
CI: true

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Cache nx
uses: actions/cache@v4
with:
path: |
.nx/cache
node_modules/.cache/nx
js/stateless.js/node_modules/.cache/nx
js/compressed-token/node_modules/.cache/nx
cli/node_modules/.cache/nx
key: nx-js-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-${{ github.sha }}
restore-keys: |
nx-js-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-
nx-js-v2-${{ runner.os }}-

- name: Setup and build
uses: ./.github/actions/setup-and-build

- name: Build stateless.js with V2
run: |
source ./scripts/devenv.sh
cd js/stateless.js
pnpm build:v2

- name: Build compressed-token with V2
run: |
source ./scripts/devenv.sh
cd js/compressed-token
pnpm build:v2

- name: Build CLI
run: |
source ./scripts/devenv.sh
npx nx build @lightprotocol/zk-compression-cli

- name: Run stateless.js tests with V2
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/stateless.js

- name: Run compressed-token tests with V2
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/compressed-token

- name: Display prover logs on failure
if: failure()
run: |
echo "=== Displaying prover logs ==="
find . -path "*/test-ledger/*prover*.log" -type f -exec echo "=== Contents of {} ===" \; -exec cat {} \; -exec echo "=== End of {} ===" \; || echo "No prover logs found"
42 changes: 32 additions & 10 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,78 @@
- reopened
- ready_for_review

name: js-tests
name: js-tests-v1

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

jobs:
stateless-js:
name: stateless-js
stateless-js-v1:
name: stateless-js-v1
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

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:
LIGHT_PROTOCOL_VERSION: V1
REDIS_URL: redis://localhost:6379
CI: true

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Cache nx
uses: actions/cache@v4
with:
path: |
.nx/cache
node_modules/.cache/nx
js/stateless.js/node_modules/.cache/nx
js/compressed-token/node_modules/.cache/nx
cli/node_modules/.cache/nx
key: nx-js-v1-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-${{ github.sha }}
restore-keys: |
nx-js-v1-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'js/**/package.json', 'cli/package.json') }}-
nx-js-v1-${{ runner.os }}-

- name: Setup and build
uses: ./.github/actions/setup-and-build

- name: Build CLI
- name: Build stateless.js with V1
run: |
source ./scripts/devenv.sh
cd js/stateless.js
pnpm build:v1

- name: Build compressed-token with V1
run: |
source ./scripts/devenv.sh
npx nx build @lightprotocol/zk-compression-cli --skip-nx-cache
cd js/compressed-token
pnpm build:v1

# Comment for breaking changes to Photon
- name: Run CLI tests
- name: Build CLI
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/zk-compression-cli
npx nx build @lightprotocol/zk-compression-cli

- name: Run stateless.js tests
- name: Run stateless.js tests with V1
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/stateless.js

- name: Run compressed-token tests
- name: Run compressed-token tests with V1
run: |
source ./scripts/devenv.sh
npx nx test @lightprotocol/compressed-token

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

- name: Setup and build
uses: ./.github/actions/setup-and-build
with:
components: "rust,node,pnpm,solana,anchor,jq,keys,dependencies"

- name: Install cargo-workspaces
run: |
Expand Down
Loading
Loading