diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a78136a..211e97c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,5 +15,12 @@ jobs: - name: Build run: cargo build - uses: taiki-e/install-action@nextest + - name: Populate test graph + run: pip install falkordb && ./resources/populate_graph.py - name: Test - run: cargo nextest run --all \ No newline at end of file + run: cargo nextest run --all + services: + falkordb: + image: falkordb/falkordb:edge + ports: + - 6379:6379 \ No newline at end of file diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index b216681..6c89c39 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -10,14 +10,10 @@ env: jobs: coverage: runs-on: linux-latest - - services: - falkordb: - image: falkordb/falkordb:edge - ports: - - 6379:6379 steps: - uses: actions/checkout@v4 + - name: Populate test graph + run: pip install falkordb && ./resources/populate_graph.py - uses: taiki-e/install-action@cargo-llvm-cov - uses: taiki-e/install-action@nextest - name: Generate Code Coverage @@ -27,4 +23,9 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: codecov.json - fail_ci_if_error: true \ No newline at end of file + fail_ci_if_error: true + services: + falkordb: + image: falkordb/falkordb:edge + ports: + - 6379:6379 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dbb9956 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,80 @@ +name: Publish on crates.io + +on: + push: + tags: [ '*' ] + +env: + CARGO_TERM_COLOR: always + +jobs: + # Ensure formatting + check-fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check Rustfmt + run: cargo fmt --all --check + + # Make sure no unwanted licenses or yanked crates have slipped in + deny: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: EmbarkStudios/cargo-deny-action@v1 + + # Make sure the release's build works + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build + run: cargo build + - uses: taiki-e/install-action@nextest + - name: Populate test graph + run: pip install falkordb && ./resources/populate_graph.py + - name: Test + run: cargo nextest run --all + services: + falkordb: + image: falkordb/falkordb:edge + ports: + - 6379:6379 + + # Ensure no clippy warnings + check-clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check Clippy + run: cargo clippy --all + + # Make sure the release's docs are full + doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Doc + run: cargo doc --all + + # Actually publish to crates.io + crates-io: + needs: + - build-linux + - doc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Cargo Release + run: cargo install cargo-release + - name: Login + run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }} + - name: Publish + run: |- + cargo release \ + publish \ + --all-features \ + --allow-branch HEAD \ + --no-confirm \ + --no-verify \ + --execute \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 16e0e7c..ca291fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,8 @@ name = "falkordb" version = "0.1.0" edition = "2021" +description = "A FalkorDB Rust client" +license = "SSPL-1.0" [dependencies] diff --git a/README.md b/README.md index 3cfd874..45093ba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -[![license](https://img.shields.io/github/license/falkordb/falkordb-client-rs.svg)](https://github.com/falkordb/falkordb-client-rs) -[![Release](https://img.shields.io/github/release/falkordb/falkordb-client-rs.svg)](https://github.com/falkordb/falkordb-client-rs/releases/latest) -[![Codecov](https://codecov.io/gh/falkordb/falkordb-client-rs/branch/main/graph/badge.svg)](https://codecov.io/gh/falkordb/falkordb-client-rs) +[![license](https://img.shields.io/github/license/falkordb/falkordb-rs.svg)](https://github.com/falkordb/falkordb-rs) +[![Release](https://img.shields.io/github/release/falkordb/falkordb-rs.svg)](https://github.com/falkordb/falkordb-rs/releases/latest) +[![Codecov](https://codecov.io/gh/falkordb/falkordb-rs/branch/main/graph/badge.svg)](https://codecov.io/gh/falkordb/falkordb-rs) +[![Docs](https://img.shields.io/docsrs/:crate)](https://docs.rs/crate/falkordb/0.1.0)\ [![Forum](https://img.shields.io/badge/Forum-falkordb-blue)](https://github.com/orgs/FalkorDB/discussions) [![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.gg/ErBEqN9E) @@ -12,6 +13,14 @@ FalkorDB Rust client ## Usage +### Installation + +Just add it to your `Cargo.toml`, like so + +```toml +falkordb = { version = "0.1.0" } +``` + ### Run FalkorDB instance Docker: @@ -22,7 +31,7 @@ docker run --rm -p 6379:6379 falkordb/falkordb Or use our [sandbox](https://cloud.falkordb.com/sandbox) -### Example +### Code Example ```rust use falkordb::FalkorClientBuilder;