diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 49d740e..4192cf2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,6 +6,19 @@ concurrency: jobs: check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "23" + - uses: pnpm/action-setup@v4 + - run: pnpm install + - run: pnpm exec biome format + - run: pnpm exec biome lint + + client-wasm: + needs: check runs-on: ubuntu-latest steps: - name: Generate nillion repo app token @@ -24,22 +37,16 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: nightly-2024-07-01 - - uses: actions/setup-node@v4 - with: - node-version: "23" + - uses: jdx/mise-action@v2 - uses: pnpm/action-setup@v4 - run: pnpm install - - run: pnpm build:proto + - run: pnpm --filter "@nillion/client-wasm" rust:build - run: pnpm --filter "@nillion/client-wasm" rust:check:format - run: pnpm --filter "@nillion/client-wasm" rust:clippy - - run: pnpm --filter "@nillion/client-vms" build - - run: pnpm --filter "@nillion/client-react-hooks" build - - run: pnpm exec biome format - - run: pnpm exec biome lint - - run: pnpm exec tsc -p client-vms/tsconfig.json - - run: pnpm exec tsc -p client-react-hooks/tsconfig.json + - run: pnpm --filter "@nillion/client-wasm" build + - run: pnpm --filter "@nillion/client-wasm" test - test-client-wasm: + client-vms: needs: check runs-on: ubuntu-latest steps: @@ -55,49 +62,57 @@ jobs: with: token: ${{ steps.generate-token.outputs.token }} submodules: 'recursive' - - name: Install rustup - uses: dtolnay/rust-toolchain@master + - uses: actions/setup-node@v4 with: - toolchain: nightly-2024-07-01 - - uses: jdx/mise-action@v2 + node-version: "23.0" - uses: pnpm/action-setup@v4 - run: pnpm install - - run: pnpm --filter "@nillion/client-wasm" test + - run: pnpm build:proto + + - run: pnpm --filter "@nillion/client-vms" build + - run: pnpm exec tsc -p client-vms/tsconfig.json - test-client-vms: - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # Aws credentials are required so that nilup can access rc builds - name: Get SDK Version id: get-sdk-version run: | VERSION=$(cat .nil-sdk.toml | sed -e "s|.*\"\(.*\)\".*|\1|g") echo "version=$VERSION" > $GITHUB_OUTPUT + - name: Install nillion SDK uses: NillionNetwork/nillion-setup-action@main with: version: ${{ steps.get-sdk-version.outputs.version }} + - uses: actions/setup-python@v5 with: python-version: "3.12" + - run: | cd client-vms/tests-nada-programs ./build.sh - - uses: actions/setup-node@v4 - with: - node-version: "23.0" - - uses: pnpm/action-setup@v4 - - run: pnpm install + - run: | nillion-devnet --seed test & sleep 10 cd client-vms pnpm vitest --coverage killall -9 nillion-devnet + - uses: davelosert/vitest-coverage-report-action@v2 if: always() with: working-directory: ./client-vms comment-on: "pr" + + client-react-hooks: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "23.0" + - uses: pnpm/action-setup@v4 + - run: pnpm install + - run: pnpm --filter "@nillion/client-react-hooks" build + - run: pnpm exec tsc -p client-react-hooks/tsconfig.json diff --git a/client-wasm/package.json b/client-wasm/package.json index f3d5019..0a5d362 100644 --- a/client-wasm/package.json +++ b/client-wasm/package.json @@ -9,10 +9,12 @@ } }, "scripts": { + "rust:clean": "cargo clean", + "rust:build": "cargo build --target wasm32-unknown-unknown --release", "rust:check:format": "cargo fmt --check", "rust:format": "cargo fmt", - "rust:clippy": "cargo clippy", - "test": "wasm-pack test --node", + "rust:clippy": "cargo clippy --target wasm32-unknown-unknown --release", + "test": "wasm-pack test --node --release", "typecheck": "echo 'no op'; exit 0", "build:watch": "echo 'no op'; exit 0", "build": "wasm-pack build --out-dir dist --out-name index"