[ci] Consolidate workflows #1420 #596
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 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: 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 |