From cdfac6c3c1a8529e3a49c62bbc2ac350f2c37c52 Mon Sep 17 00:00:00 2001 From: Uttarayan Mondal Date: Wed, 2 Jun 2021 10:54:14 +0530 Subject: [PATCH] Added workflows to generate docs --- .github/workflows/docs.yaml | 39 +++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yaml | 22 +++++++++++++++++++++ src/tts.rs | 6 +++--- 3 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docs.yaml create mode 100644 .github/workflows/rust.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 00000000..2780647e --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,39 @@ +name: Documentation + +on: + push: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install latest toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + default: true + override: true + - name: Build Docs + run: cargo doc --color=always + - name: Copy docs and push + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git checkout gh-pages + + rm -rf docs + cp -r target/doc ./docs + cp index.html docs/ + + git add docs + git commit --allow-empty -am "Auto Generated Documentation" + git push diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml new file mode 100644 index 00000000..0f95efcb --- /dev/null +++ b/.github/workflows/rust.yaml @@ -0,0 +1,22 @@ +name: Rust Build Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/src/tts.rs b/src/tts.rs index a677503b..da0fd978 100644 --- a/src/tts.rs +++ b/src/tts.rs @@ -1,5 +1,5 @@ -use pyo3::prelude::*; -use pyo3::types::IntoPyDict; +use pyo3::{types::PyModule, PyObject, PyResult, Python}; +// use pyo3::types::IntoPyDict; #[derive(Debug)] pub struct Speech { pyobject_speech: PyObject, @@ -27,7 +27,7 @@ impl Speech { } /// # Safety - /// The save function is a wrapper around google_speech.Speech.save + /// The save function is a wrapper around google_speech.Speech.save python function /// which might be unsafe pub unsafe fn save>(&self, path: S) -> PyResult<()> { Python::with_gil(|py| {