Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Zip Tests #50

Merged
merged 6 commits into from
Jan 15, 2025
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
58 changes: 54 additions & 4 deletions .github/workflows/build_tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,60 @@ on:
workflow_dispatch:

jobs:
run_tests:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Install b3sum
run: cargo install b3sum

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl jq zip unzip coreutils

- name: Run node in background
id: run_node
env:
INITIAL_AGENT_NAMES: ${{ secrets.INITIAL_AGENT_NAMES }}
INITIAL_AGENT_URLS: ${{ secrets.INITIAL_AGENT_URLS }}
INITIAL_AGENT_MODELS: ${{ secrets.INITIAL_AGENT_MODELS }}
INITIAL_AGENT_API_KEYS: ${{ secrets.INITIAL_AGENT_API_KEYS }}
API_V2_KEY: ${{ secrets.API_V2_KEY }}
EMBEDDINGS_SERVER_URL: ${{ secrets.EMBEDDINGS_SERVER_URL }}
SHINKAI_NODE_ADDR: "http://localhost:9550"
BEARER_TOKEN: ${{ secrets.API_V2_KEY }}
INITIALIZATION_DATA: ${{ secrets.INITIALIZATION_DATA }}
DOWNLOAD_PREFIX: "https://download.shinkai.com/tools"
SKIP_IMPORT_FROM_DIRECTORY: true
SHINKAI_STORE_ADDR: "https://shinkai-store-302883622007.us-central1.run.app"
SHINKAI_STORE_TOKEN: ${{ secrets.SHINKAI_STORE_TOKEN }}
run: |
./scripts/run_node.sh &
timeout 60 bash -c 'until curl -s --location "$SHINKAI_NODE_ADDR/v2/health_check" | jq -e ".status == \"ok\"" > /dev/null; do sleep 1; done'
curl --location "$SHINKAI_NODE_ADDR/v2/initial_registration" \
--header 'Content-Type: application/json; charset=utf-8' \
--data "$INITIALIZATION_DATA"
mkdir -p ./packages
deno test --allow-read --allow-write --allow-env --allow-net --allow-run scripts/
rm -rf ./shinkai-node/storage
build_tools:
needs: run_tests
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -56,11 +109,8 @@ jobs:
curl --location "$SHINKAI_NODE_ADDR/v2/initial_registration" \
--header 'Content-Type: application/json; charset=utf-8' \
--data "$INITIALIZATION_DATA"
mkdir -p ./packages
deno run --allow-read --allow-write --allow-env --allow-net --allow-run scripts/build_tools.ts
if jq -e '.[] | select(.description == "")' packages/directory.json > /dev/null; then
echo "Error: Empty descriptions found in packages/directory.json"
exit 1
fi

- name: Upload to Cloudflare R2
if: steps.run_node.outcome == 'success'
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ tools/
├── packages/
│ ├── tool.zip # Zipped contents of the tool.
│ └── directory.json # A listing of the available tools.
```
```

## Run Tests
```
BEARER_TOKEN=debug SHINKAI_NODE_ADDR="http://0.0.0.0:9550" deno test scripts/ --allow-all
```
Loading
Loading