From 0c457a4ec6e76cc67046ef8fa16b25115eec33c7 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Fri, 20 Oct 2023 20:13:17 -0500 Subject: [PATCH] Add rustdoc workflow, add caching to rust workflow maybe --- .github/workflows/ldoc.yml | 8 ++++---- .github/workflows/rust.yml | 6 +++++- .github/workflows/rustdoc.yml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/rustdoc.yml diff --git a/.github/workflows/ldoc.yml b/.github/workflows/ldoc.yml index 41ef286..b459e9a 100644 --- a/.github/workflows/ldoc.yml +++ b/.github/workflows/ldoc.yml @@ -1,7 +1,7 @@ # From https://github.com/lunarmodules/ldoc/blob/master/.github/workflows/doc.yml # Based on https://gist.github.com/domenic/ec8b0fc8ab45f39403dd -name: Build Docs +name: Build Lua Docs on: pull_request: branches: @@ -23,9 +23,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get ldoc_gen - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Ottatop/ldoc_gen path: ./ldoc_gen @@ -47,4 +47,4 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./ldoc_gen/.ldoc_gen/doc - destination_dir: ${{ env.BRANCH_NAME }} + destination_dir: ${{ env.BRANCH_NAME }}/lua diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 11525ed..5d4e0a7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,7 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Run rustup + run: rustup toolchain install stable + - name: Cache stuff maybe + uses: Swatinem/rust-cache@v2 - name: Get dependencies run: sudo apt update && sudo apt install libwayland-dev libxkbcommon-dev libudev-dev libinput-dev libgbm-dev libseat-dev libsystemd-dev - name: Build diff --git a/.github/workflows/rustdoc.yml b/.github/workflows/rustdoc.yml new file mode 100644 index 0000000..056a265 --- /dev/null +++ b/.github/workflows/rustdoc.yml @@ -0,0 +1,34 @@ +name: Build Rust Docs +on: + pull_request: + branches: + - main + paths: + - "api/rust/**" + push: + branches: + - main + paths: + - "api/rust/**" + +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +jobs: + build: + name: Build docs + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build docs + run: cd ./api/rust && cargo doc + - name: Create index.html + run: echo "" > ./api/rust/target/doc/index.html + - name: Deploy + if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./api/rust/target/doc + destination_dir: ${{ env.BRANCH_NAME }}/rust