diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..4790ad17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +on: + push: + branches: + - master + pull_request: + branches: + - master + +name: Continuous integration + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + + include: + - rust: stable + features: "" + - rust: beta + features: "" + - rust: nightly + features: "--all-features" + + steps: + - uses: actions/checkout@v1 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + + - name: build + uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose ${{ matrix.features }} + + - name: test + uses: actions-rs/cargo@v1 + with: + command: test + args: --verbose ${{ matrix.features }} + + clippy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: clippy + + - name: clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-targets --all-features -- -D warnings + + style: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rustfmt + + - name: fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..96ef6c0b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..57b4c75c --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "teloxide-core" +version = "0.1.0" +edition = "2018" +authors = [ + "Temirkhan Myrzamadi ", + "Waffle Lapkin ", + "p0lunin ", + "Mishko torop'izhko", + "Mr-Andersen", + "Sergey Levitin ", + "Rustem B. ", + "Alexey Fedechkin " +] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +[features] +# features those require nightly compiler +nightly = [] + +[package.metadata."docs.rs"] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/README.md b/README.md new file mode 100644 index 00000000..8026aea2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# teloxide-core + +Core part of `teloxide` library. \ No newline at end of file diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..ecb9c8fb --- /dev/null +++ b/netlify.toml @@ -0,0 +1,12 @@ +[build] +# Directory (relative to root of your repo) that contains the deploy-ready +# HTML files and assets generated by the build. If a base directory has +# been specified, include it in the publish directory path. +publish = "target/doc" + +# Default build command. +command = 'curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --profile minimal && source $HOME/.cargo/env && RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --no-deps --all-features' + +[[redirects]] + from = "/*" + to = "/teloxide_core" diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..1adb08cb --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,12 @@ +//! Core part of `teloxide` library. +// TODO: expand docs + +// we pass "--cfg docsrs" when building docs to add `This is supported on feature="..." only.` +// +// To properly build docs of this crate run +// ```console +// $ RUSTDOCFLAGS="--cfg docsrs" cargo doc --open --all-features +// ``` +#![cfg_attr(all(docsrs, feature = "nightly"), feature(doc_cfg))] +#![forbid(unsafe_code)] +#![deny(missing_docs)]