Skip to content
Merged
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
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

name: lint

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.PAT_TOKEN }}

- name: Install stable Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
working-directory: ./light-system-programs
run: |
cargo fmt --all -- --check

# TODO(vadorovsky): Enable clippy once we fix the issue in Solana:
# https://github.com/solana-labs/solana/issues/29971
# - name: Run cargo clippy
# working-directory: ./light-system-programs
# run: |
# cargo clippy -- -D warnings
58 changes: 58 additions & 0 deletions .github/workflows/programs-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

name: programs-test

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
path: light-protocol-onchain
submodules: true
token: ${{ secrets.PAT_TOKEN }}

# - name: Checkout Solana sources
# uses: actions/checkout@v2
# with:
# path: solana
# repository: solana-labs/solana

- name: Install stable Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "16"

- name: Install Typescript
run: |
npm i -g typescript

- name: Install Solana and Anchor
run: |
docker run -d --name solana-install --entrypoint=/bin/sleep vadorovsky/solana:audit inf
docker cp solana-install:/usr/local/bin/. /usr/local/bin
docker cp solana-install:/usr/local/cargo/bin/anchor /usr/local/bin
docker rm -f solana-install
solana-keygen new --no-bip39-passphrase

- name: Run tests
working-directory: light-protocol-onchain
run: |
./build.sh
./test.sh
26 changes: 22 additions & 4 deletions build-sdk.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
cd light-sdk-ts && yarn && yarn run build & sleep 5 && kill $! && cd ..;
cd light-circuits && rm -rf ./node_modules && yarn && cd -;
cd light-system-programs && rm -rf ./node_modules && yarn && cd -;
cd mock-app-verifier && rm -rf ./node_modules && yarn && cd -;
#!/usr/bin/env bash

set -e

pushd light-sdk-ts
yarn run build
popd

pushd light-circuits
rm -rf node_modules
yarn
popd

pushd light-system-programs
rm -rf node_modules
yarn
popd

pushd mock-app-verifier
rm -rf node_modules
yarn
popd
24 changes: 16 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
cd ..;
if [ ! -f ./solana ]; then
git clone git@github.com:ananas-block/solana.git;
cd solana && git fetch -a && git checkout audit && cd validator/ && cargo build && cd ../..;
fi
cd light-protocol-onchain/light-sdk-ts && yarn i && yarn run build; \
cd ../light-system-programs && yarn install && anchor build; \
cd ../light-circuits && yarn i && cd ..;
#!/usr/bin/env bash

set -e

pushd light-sdk-ts
yarn install
yarn run build
popd

pushd light-system-programs
yarn install
anchor build
popd

pushd light-circuits
yarn install
popd
Loading