Skip to content

Commit

Permalink
auto-update readme of crate
Browse files Browse the repository at this point in the history
  • Loading branch information
ZibanPirate committed Nov 21, 2024
1 parent 3832fb3 commit 1801283
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/rust-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
build_and_test:
name: kuliya - latest
runs-on: ubuntu-latest
env:
CWD: "rust"
strategy:
matrix:
toolchain:
Expand All @@ -24,9 +26,20 @@ jobs:
- run: rustup update ${{ matrix.toolchain }}
- run: rustup default ${{ matrix.toolchain }}
- run: rustup component add clippy
- run: cd rust && cargo clippy --all-features -- -Dwarnings
- run: cd rust && cargo build --verbose
- run: cd rust && cargo test --verbose
- run: cd rust && cargo test --verbose --lib --bins --tests --features serde_derive
- run: cd rust && cargo test --verbose --lib --bins --tests --no-default-features --features storage
- run: cd rust && cargo test --verbose --all-features
- run: cargo install cargo-readme
- run: cargo readme > README.md
working-directory: ${{ env.CWD }}
- run: cargo clippy --all-features -- -Dwarnings
working-directory: ${{ env.CWD }}
- run: cargo build --verbose
working-directory: ${{ env.CWD }}
- name: "is docs updated and generated files are committed"
run: exit $(git status --porcelain | wc -l)
- run: cargo test --verbose
working-directory: ${{ env.CWD }}
- run: cargo test --verbose --lib --bins --tests --features serde_derive
working-directory: ${{ env.CWD }}
- run: cargo test --verbose --lib --bins --tests --no-default-features --features storage
working-directory: ${{ env.CWD }}
- run: cargo test --verbose --all-features
working-directory: ${{ env.CWD }}
4 changes: 2 additions & 2 deletions .github/workflows/rust-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
name: cargo publish
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CWD: "rust"
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CWD: "rust"
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
Expand Down
25 changes: 18 additions & 7 deletions rust/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# kuliya for Rust
# kuliya

Algeria's college hierarchy dataset as Cargo package
Algeria's college hierarchy dataset as a crate with useful APIs.

# Get started
Example

WIP
```rust
use kuliya::r#static::api::get_node_by_path;

# Contribute
let faculty_of_science_and_technology = get_node_by_path("umkb/fst");

Please install Rust compiler using https://rustup.rs/
assert_eq!(faculty_of_science_and_technology.is_some(), true);

Feel free to ask for help in [#kuliya](https://dzcode.slack.com/archives/C01C0155CKC) group chat
let faculty_of_science_and_technology = faculty_of_science_and_technology.unwrap();

assert_eq!(faculty_of_science_and_technology.name.ar, "كلية العلوم والتكنلوجيا");

// when the path is not found, the function returns None
let non_existing_node = get_node_by_path("umkb/fst/unknown");

assert_eq!(non_existing_node.is_none(), true);
```

License: MIT

0 comments on commit 1801283

Please sign in to comment.