From 921e498d9d38d8314e170864b7767977838921ec Mon Sep 17 00:00:00 2001 From: Jeehoon Kang Date: Wed, 21 Jun 2023 02:52:45 +0900 Subject: [PATCH] Add rustdoc action --- .github/bors.toml | 2 -- .github/workflows/ci.yml | 41 ---------------------------------- .github/workflows/rustdoc.yaml | 37 ++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 43 deletions(-) delete mode 100644 .github/bors.toml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/rustdoc.yaml diff --git a/.github/bors.toml b/.github/bors.toml deleted file mode 100644 index e52aa08..0000000 --- a/.github/bors.toml +++ /dev/null @@ -1,2 +0,0 @@ -delete_merged_branches = true -status = ["ci"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 94d7ab0..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI - -on: - pull_request: - push: - branches: - - staging - - trying - -defaults: - run: - shell: bash - -jobs: - ci: - name: ci - runs-on: [self-hosted, ubuntu-22.04] - steps: - - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - components: rust-src, rustfmt, clippy - - name: Install Clang - run: sudo apt-get update && sudo apt-get install -yy clang - - name: Install RISC-V - run: (echo 'Acquire::http { Proxy "http://10.22.0.2:3142"; }' | sudo tee -a /etc/apt/apt.conf.d/01proxy) && sudo apt-get update && sudo apt-get install -yy gcc-riscv64-linux-gnu g++-riscv64-linux-gnu qemu-user-static - - name: Check - run: cargo check --all --verbose - - name: Rustfmt - run: cargo fmt --all -- --check - - name: Clippy - run: cargo clippy --all -- -D warnings - - name: Test (Debug) - run: RUST_MIN_STACK=33554432 cargo test - - name: Test (Release) - run: RUST_MIN_STACK=33554432 cargo test --release - - name: Bench - run: cd bench; make run diff --git a/.github/workflows/rustdoc.yaml b/.github/workflows/rustdoc.yaml new file mode 100644 index 0000000..958abe5 --- /dev/null +++ b/.github/workflows/rustdoc.yaml @@ -0,0 +1,37 @@ +name: rustdoc +on: + push: + branches: + - main + +env: + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 + RUSTFLAGS: "-D warnings -W unreachable-pub" + RUSTUP_MAX_RETRIES: 10 + +jobs: + rustdoc: + if: github.repository == 'kaist-cp/kecc-public' + runs-on: [self-hosted, ubuntu-22.04] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Rustup + run: if ! command -v rustup &>/dev/null; then (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y); fi + + - name: Install Rust toolchain + run: source "$HOME/.cargo/env"; rustup update --no-self-update stable + + - name: Build Documentation + run: source "$HOME/.cargo/env"; cargo doc --all + + - name: Deploy Docs + uses: peaceiris/actions-gh-pages@364c31d33bb99327c77b3a5438a83a357a6729ad # v3.4.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./target/doc + force_orphan: true