From ca3b149b39163c466e16b683478104f7c1766fc5 Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Fri, 9 Aug 2024 15:44:53 -0400 Subject: [PATCH] ci: fix book CI (#252) * ci: fix book ci * ci: add `--locked` --- .github/workflows/architecture-book.yml | 11 +++++++---- .github/workflows/audit.yml | 1 + .github/workflows/deny.yml | 1 + .github/workflows/monero-book.yml | 11 +++++++---- .github/workflows/user-book.yml | 11 +++++++---- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/architecture-book.yml b/.github/workflows/architecture-book.yml index 5b99ca8..3e6decf 100644 --- a/.github/workflows/architecture-book.yml +++ b/.github/workflows/architecture-book.yml @@ -4,8 +4,11 @@ name: Architecture mdBook on: push: - paths: - - 'books/architecture/**' + branches: ['main'] + paths: ['books/architecture/**'] + pull_request: + paths: ['books/architecture/**'] + workflow_dispatch: env: # Version of `mdbook` to install. @@ -30,8 +33,8 @@ jobs: - name: Install mdBook run: | - cargo install --version ${MDBOOK_VERSION} mdbook - cargo install --version ${MDBOOK_LAST_CHANGED_VERSION} mdbook-last-changed + cargo install --locked --version ${MDBOOK_VERSION} mdbook || echo "mdbook already exists" + cargo install --locked --version ${MDBOOK_LAST_CHANGED_VERSION} mdbook-last-changed || echo "mdbook-last-changed already exists" - name: Build run: mdbook build books/architecture \ No newline at end of file diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 9aa4451..84b1995 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -7,6 +7,7 @@ on: paths: - '**/Cargo.toml' - '**/Cargo.lock' + workflow_dispatch: env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/deny.yml b/.github/workflows/deny.yml index 1301bb1..2ff2b6f 100644 --- a/.github/workflows/deny.yml +++ b/.github/workflows/deny.yml @@ -7,6 +7,7 @@ on: paths: - '**/Cargo.toml' - '**/Cargo.lock' + workflow_dispatch: env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/monero-book.yml b/.github/workflows/monero-book.yml index 33887bc..ab3660e 100644 --- a/.github/workflows/monero-book.yml +++ b/.github/workflows/monero-book.yml @@ -4,8 +4,11 @@ name: Monero mdBook on: push: - paths: - - 'books/protocol/**' + branches: ['main'] + paths: ['books/protocol/**'] + pull_request: + paths: ['books/protocol/**'] + workflow_dispatch: env: # Version of `mdbook` to install. @@ -30,8 +33,8 @@ jobs: - name: Install mdBook run: | - cargo install --version ${MDBOOK_VERSION} mdbook - cargo install --version ${MDBOOK_SVGBOB_VERSION} mdbook-svgbob + cargo install --locked --version ${MDBOOK_VERSION} mdbook || echo "mdbook already exists" + cargo install --locked --version ${MDBOOK_SVGBOB_VERSION} mdbook-svgbob || echo "mdbook-svgbob already exists" - 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 index fc95c94..cec2551 100644 --- a/.github/workflows/user-book.yml +++ b/.github/workflows/user-book.yml @@ -4,8 +4,11 @@ name: User mdBook on: push: - paths: - - 'books/user/**' + branches: ['main'] + paths: ['books/user/**'] + pull_request: + paths: ['books/user/**'] + workflow_dispatch: env: # Version of `mdbook` to install. @@ -30,8 +33,8 @@ jobs: - name: Install mdBook run: | - cargo install --version ${MDBOOK_VERSION} mdbook - cargo install --version ${MDBOOK_LAST_CHANGED_VERSION} mdbook-last-changed + cargo install --locked --version ${MDBOOK_VERSION} mdbook || echo "mdbook already exists" + cargo install --locked --version ${MDBOOK_LAST_CHANGED_VERSION} mdbook-last-changed || echo "mdbook-last-changed already exists" - name: Build run: mdbook build books/user \ No newline at end of file