From 4eb7cc45a1740cb3b16222d6823f577c6ac8178b Mon Sep 17 00:00:00 2001 From: Karn Kaul Date: Fri, 28 Mar 2025 10:00:04 -0700 Subject: [PATCH 1/4] Add build book job to CI --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/guide.yml | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/guide.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 985eec1..1697d69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci-push +name: ci on: push: branches-ignore: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 52f50ff..f395558 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,7 +24,7 @@ jobs: - name: build book run: | cd guide - cmake -P build.cmake + cmake -P build.cmake || exit 1 ls book - name: setup pages uses: actions/configure-pages@v4 diff --git a/.github/workflows/guide.yml b/.github/workflows/guide.yml new file mode 100644 index 0000000..b2a3280 --- /dev/null +++ b/.github/workflows/guide.yml @@ -0,0 +1,23 @@ +name: ci-guide +on: + push: + branches-ignore: + - staging +jobs: + build-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: init + run: | + url="https://github.com/rust-lang/mdBook/releases/download/v0.4.47/mdbook-v0.4.47-x86_64-unknown-linux-gnu.tar.gz" + mkdir mdbook + curl -sSL $url | tar -xz --directory=./mdbook + echo `pwd`/mdbook >> $GITHUB_PATH + - name: build + run: | + cd guide + cmake -P build.cmake || exit 1 + ls book From 6399325115610ffad5057887644e83b7215f6dac Mon Sep 17 00:00:00 2001 From: Karn Kaul Date: Fri, 28 Mar 2025 10:05:40 -0700 Subject: [PATCH 2/4] Test book build breakage --- guide/book.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/book.toml b/guide/book.toml index 0c64e99..83700c4 100644 --- a/guide/book.toml +++ b/guide/book.toml @@ -6,5 +6,5 @@ title = "Learn Vulkan" [output.html] theme = "theme" -additional-js = ["theme/lang_toggle.js"] -additional-css = ["theme/lang_toggle.css"] +additional-js = ["theme/lang-toggle.js"] +additional-css = ["theme/lang-toggle.css"] From cd027727dab42e2c8e0672ef7b4505cfc5185b4c Mon Sep 17 00:00:00 2001 From: Karn Kaul Date: Fri, 28 Mar 2025 10:07:46 -0700 Subject: [PATCH 3/4] `execute_process()`: treat errors as fatal --- guide/build.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guide/build.cmake b/guide/build.cmake index acf4de4..8589bc4 100644 --- a/guide/build.cmake +++ b/guide/build.cmake @@ -6,7 +6,7 @@ function(BuildBook LANGUAGE SOURCE_DIR TARGET_DIR) message(WARNING "Skipping '${LANGUAGE}' – SUMMARY.md not found at ${SOURCE_DIR}") return() endif() - + if(NOT EXISTS "${SOURCE_DIR}/book.toml") message(WARNING "Skipping '${LANGUAGE}' – book.toml not found at ${SOURCE_DIR}") return() @@ -16,10 +16,11 @@ function(BuildBook LANGUAGE SOURCE_DIR TARGET_DIR) execute_process( COMMAND mdbook build -d ${TARGET_DIR} WORKING_DIRECTORY ${SOURCE_DIR} + COMMAND_ERROR_IS_FATAL ANY ) endfunction() -# Copy the theme folder +# Copy the theme folder file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/theme" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/translations") BuildBook("en" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/book") From e4953d51b9c4056210a2636c175a39db137ae99d Mon Sep 17 00:00:00 2001 From: Karn Kaul Date: Fri, 28 Mar 2025 10:08:36 -0700 Subject: [PATCH 4/4] Revert deliberate breakage --- guide/book.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/book.toml b/guide/book.toml index 83700c4..0c64e99 100644 --- a/guide/book.toml +++ b/guide/book.toml @@ -6,5 +6,5 @@ title = "Learn Vulkan" [output.html] theme = "theme" -additional-js = ["theme/lang-toggle.js"] -additional-css = ["theme/lang-toggle.css"] +additional-js = ["theme/lang_toggle.js"] +additional-css = ["theme/lang_toggle.css"]