Skip to content

chore: add README and fix coverage recipe #2

chore: add README and fix coverage recipe

chore: add README and fix coverage recipe #2

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
check:
name: Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache cargo registry & build
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Check compilation
run: cargo check --workspace
- name: Check formatting
if: matrix.os == 'ubuntu-latest'
run: cargo fmt --all -- --check
- name: Clippy lints
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Run tests
run: cargo test --workspace
- name: Check copyright headers
if: matrix.os != 'windows-latest'
shell: bash
run: |
missing=0
for f in $(find . -name '*.rs' -not -path '*/gen/*' -not -path '*/target/*'); do
if ! head -1 "$f" | grep -q '^// Copyright AGNTCY'; then
echo "Missing header: $f"
missing=$((missing + 1))
fi
done
if [ "$missing" -gt 0 ]; then
echo "ERROR: $missing file(s) missing copyright header"
exit 1
fi
publish:
name: Publish crates
needs: check
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish a2a
run: cargo publish -p a2a --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish a2a-client
run: cargo publish -p a2a-client --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish a2a-server
run: cargo publish -p a2a-server --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish a2a-pb
run: cargo publish -p a2a-pb --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish a2a-grpc
run: cargo publish -p a2a-grpc --token ${{ secrets.CARGO_REGISTRY_TOKEN }}