From eb65efa7fb4b3f405cccdcbc4bdaea1c2b9ddc9b Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Tue, 6 Aug 2024 21:04:11 -0400 Subject: [PATCH] ci: add book build tests (#249) * ci: add book build tests * ci: add `mdbook-svgbob` * ci: `|` --- .github/workflows/architecture-book.yml | 37 +++++++++++++++++++++++++ .github/workflows/monero-book.yml | 37 +++++++++++++++++++++++++ .github/workflows/user-book.yml | 37 +++++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 .github/workflows/architecture-book.yml create mode 100644 .github/workflows/monero-book.yml create mode 100644 .github/workflows/user-book.yml diff --git a/.github/workflows/architecture-book.yml b/.github/workflows/architecture-book.yml new file mode 100644 index 00000000..5b99ca83 --- /dev/null +++ b/.github/workflows/architecture-book.yml @@ -0,0 +1,37 @@ +# This action attempts to build the architecture book, if changed. + +name: Architecture mdBook + +on: + push: + paths: + - 'books/architecture/**' + +env: + # Version of `mdbook` to install. + MDBOOK_VERSION: 0.4.36 + # Version of `mdbook-last-changed` to install. + # . + MDBOOK_LAST_CHANGED_VERSION: 0.1.4 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/mdbook + ~/.cargo/bin/mdbook-last-changed + key: architecture-book + + - name: Install mdBook + run: | + cargo install --version ${MDBOOK_VERSION} mdbook + cargo install --version ${MDBOOK_LAST_CHANGED_VERSION} mdbook-last-changed + + - name: Build + run: mdbook build books/architecture \ No newline at end of file diff --git a/.github/workflows/monero-book.yml b/.github/workflows/monero-book.yml new file mode 100644 index 00000000..33887bcc --- /dev/null +++ b/.github/workflows/monero-book.yml @@ -0,0 +1,37 @@ +# This action attempts to build the Monero book, if changed. + +name: Monero mdBook + +on: + push: + paths: + - 'books/protocol/**' + +env: + # Version of `mdbook` to install. + MDBOOK_VERSION: 0.4.36 + # Version of `mdbook-svgbob` to install. + # . + MDBOOK_SVGBOB_VERSION: 0.2.1 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/mdbook + ~/.cargo/bin/mdbook-svgbob + key: monero-book + + - name: Install mdBook + run: | + cargo install --version ${MDBOOK_VERSION} mdbook + cargo install --version ${MDBOOK_SVGBOB_VERSION} mdbook-svgbob + + - name: Build + run: mdbook build books/protocol \ No newline at end of file diff --git a/.github/workflows/user-book.yml b/.github/workflows/user-book.yml new file mode 100644 index 00000000..fc95c94e --- /dev/null +++ b/.github/workflows/user-book.yml @@ -0,0 +1,37 @@ +# This action attempts to build the user book, if changed. + +name: User mdBook + +on: + push: + paths: + - 'books/user/**' + +env: + # Version of `mdbook` to install. + MDBOOK_VERSION: 0.4.36 + # Version of `mdbook-last-changed` to install. + # . + MDBOOK_LAST_CHANGED_VERSION: 0.1.4 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/mdbook + ~/.cargo/bin/mdbook-last-changed + key: user-book + + - name: Install mdBook + run: | + cargo install --version ${MDBOOK_VERSION} mdbook + cargo install --version ${MDBOOK_LAST_CHANGED_VERSION} mdbook-last-changed + + - name: Build + run: mdbook build books/user \ No newline at end of file