Skip to content

Commit

Permalink
chore: split ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pablojhl committed Jan 30, 2025
1 parent bab0f0c commit f387e0b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 29 deletions.
69 changes: 42 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
6 changes: 4 additions & 2 deletions client-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f387e0b

Please sign in to comment.