Add rustdoc action

This commit is contained in:
Jeehoon Kang
2023-06-21 02:52:45 +09:00
parent a02a928bf9
commit 921e498d9d
3 changed files with 37 additions and 43 deletions

2
.github/bors.toml vendored
View File

@@ -1,2 +0,0 @@
delete_merged_branches = true
status = ["ci"]

View File

@@ -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

37
.github/workflows/rustdoc.yaml vendored Normal file
View File

@@ -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