diff --git a/.github/labeler.yml b/.github/labeler.yml index ce48fb3..de173e8 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,27 +1,31 @@ -# Add 'data' to any changes within '_data' folder or any subfolders data: - - _data/**/* + - changed-files: + - any-glob-to-any-file: "_data/**" -# Add 'schemas' to any changes within '_schemas' folder or any subfolders schemas: - - _schemas/**/* + - changed-files: + - any-glob-to-any-file: "_schemas/**" -# Add 'csharp' to any changes within 'csharp' folder or any subfolders csharp: - - csharp/**/* + - changed-files: + - any-glob-to-any-file: "csharp/**" -# Add 'java' to any changes within 'java' folder or any subfolders java: - - java/**/* + - changed-files: + - any-glob-to-any-file: "java/**" -# Add 'javascript' to any changes within 'javascript' folder or any subfolders javascript: - - javascript/**/* + - changed-files: + - any-glob-to-any-file: "javascript/**" -# Add 'php' to any changes within 'php' folder or any subfolders php: - - php/**/* + - changed-files: + - any-glob-to-any-file: "php/**" -# Add 'python' to any changes within 'python' folder or any subfolders python: - - python/**/* + - changed-files: + - any-glob-to-any-file: "python/**" + +rust: + - changed-files: + - any-glob-to-any-file: "rust/**" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 70115fb..9cdb111 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,12 +1,13 @@ name: "Pull Request Labeler" on: - - pull_request_target + - pull_request jobs: triage: runs-on: ubuntu-latest steps: - - uses: actions/labeler@main + - uses: actions/checkout@v4 + - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true diff --git a/.github/workflows/rust-checks.yml b/.github/workflows/rust-checks.yml new file mode 100644 index 0000000..a6c038a --- /dev/null +++ b/.github/workflows/rust-checks.yml @@ -0,0 +1,26 @@ +name: "Rust Checks" + +on: + pull_request: + paths: + - ".github/workflows/rust-checks.yml" + - "rust/**" + +env: + CARGO_TERM_COLOR: always + +jobs: + build_and_test: + name: kuliya - latest + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + - beta + - nightly + steps: + - uses: actions/checkout@v3 + - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - run: cd rust && cargo build --verbose + - run: cd rust && cargo test --verbose diff --git a/README.md b/README.md index cf1cc4f..b21e82b 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ You can find more about each language by clicking on the language name | [Python](./python) | n/a | n/a | n/a | n/a | | [Java](./java) | n/a | n/a | n/a | n/a | | [C#](./csharp) | n/a | n/a | n/a | n/a | +| [Rust](./rust) | WIP | WIP | WIP | n/a | ## Contributing diff --git a/rust/.gitignore b/rust/.gitignore new file mode 100644 index 0000000..1de5659 --- /dev/null +++ b/rust/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/rust/Cargo.lock b/rust/Cargo.lock new file mode 100644 index 0000000..db5910a --- /dev/null +++ b/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "kuliya" +version = "0.1.0" diff --git a/rust/Cargo.toml b/rust/Cargo.toml new file mode 100644 index 0000000..fd58ce3 --- /dev/null +++ b/rust/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "kuliya" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rust/README.md b/rust/README.md new file mode 100644 index 0000000..f49ed30 --- /dev/null +++ b/rust/README.md @@ -0,0 +1,13 @@ +# kuliya for Rust + +Algeria's college hierarchy dataset as Cargo package + +# Get started + +WIP + +# Contribute + +Please install Rust compiler using https://rustup.rs/ + +Feel free to ask for help in [#kuliya](https://dzcode.slack.com/archives/C01C0155CKC) group chat diff --git a/rust/src/lib.rs b/rust/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/rust/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}