Skip to content

[server] Serve agdb_studio from the server #1486 #599

[server] Serve agdb_studio from the server #1486

[server] Serve agdb_studio from the server #1486 #599

Workflow file for this run

name: agdb_server
on:
pull_request:
branches: ["main"]
paths:
- agdb_server/**
- agdb_api/rust/**
- agdb/**
- agdb_derive/**
- .github/workflows/agdb_server.yaml
jobs:
agdb_server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm ci && npm run build
working-directory: agdb_api/typescript
- run: npm ci && npm run build
working-directory: agdb_studio
- run: cargo fmt -p agdb_server -p agdb_api --check
- run: cargo clippy -p agdb_server -p agdb_api --all-targets --all-features -- -D warnings
- uses: taiki-e/install-action@cargo-llvm-cov
- run: rustup component add llvm-tools-preview
- run: cargo llvm-cov -p agdb_server -p agdb_api --all-features --ignore-filename-regex "agdb(.|..)src|agdb_derive" --fail-uncovered-functions 41 --fail-uncovered-lines 200 --show-missing-lines
agdb_server_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker build --pull -t agnesoft/agdb:dev -f agdb_server/containerfile .
- run: docker compose -f agdb_server/compose.yaml up --wait
- run: sleep 5
- run: curl -s http://localhost:3000/studio
- run: if [[ "$(curl -s http://localhost:3000/api/v1/cluster/status | grep "\"leader\":true")" == "" ]]; then exit 1; fi
- run: |
token=$(curl -X POST http://localhost:3002/api/v1/cluster/user/login -H "Content-Type: application/json" -d '{"username":"admin","password":"admin"}')
curl -H "Authorization: Bearer $token" -X POST http://localhost:3002/api/v1/admin/shutdown
curl -H "Authorization: Bearer $token" -X POST http://localhost:3000/api/v1/admin/shutdown
curl -H "Authorization: Bearer $token" -X POST http://localhost:3001/api/v1/admin/shutdown