From dd4ff9f8875e289094e4377f2bef6277303a267c Mon Sep 17 00:00:00 2001 From: Seasawher <47292598+Seasawher@users.noreply.github.com> Date: Sun, 6 Sep 2026 23:57:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?link=20check=20=E3=82=92=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E3=81=95=E3=81=9B=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 6 +---- .github/workflows/link_check.yml | 40 ++++++++++++++++++++++++++++++++ lakefile.lean | 7 +++++- 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/link_check.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a4cfe35e..9d051dd2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,6 +31,7 @@ jobs: rm elan-init.sh echo "$HOME/.elan/bin" >> $GITHUB_PATH + # このステップは lake run build_html を実行するために必要 - name: Setup Node.js uses: actions/setup-node@v7 with: @@ -44,11 +45,6 @@ jobs: - name: build markdown and HTML files run: lake run build_html - - name: Run Link Checker - uses: lycheeverse/lychee-action@v2 - with: - args: "./booksrc/**/*.md" - - name: Upload artifact uses: actions/upload-pages-artifact@v5 with: diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml new file mode 100644 index 00000000..02da947a --- /dev/null +++ b/.github/workflows/link_check.yml @@ -0,0 +1,40 @@ +name: Link Check + +on: + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + link_check: + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Install elan + run: | + curl -O --location https://elan.lean-lang.org/elan-init.sh + sh elan-init.sh -y --default-toolchain stable + rm elan-init.sh + echo "$HOME/.elan/bin" >> $GITHUB_PATH + + - name: build markdown files + run: lake run build_md + + - name: Run Link Checker + uses: lycheeverse/lychee-action@v2 + with: + args: "./booksrc/**/*.md" diff --git a/lakefile.lean b/lakefile.lean index 98cb2e49..3f2e88b6 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -53,6 +53,11 @@ def runCmd else if !out.stdout.isEmpty then IO.println out.stdout.trimAscii.copy +/-- markdown ファイルを生成する -/ +script build_md do + runCmd "lake exe mdgen LeanByExample booksrc --count --copy" + return 0 + /-- mdgen と mdbook を順に実行し、 Lean ファイルから Markdown ファイルと HTML ファイルを生成する。-/ script build_html do @@ -64,7 +69,7 @@ script build_html do runCmd "node scripts/updateSeoMetadata.mjs" return 0 -/-- `lake run build_pdf` で PDF を生成する -/ +/-- PDF を生成する -/ script build_pdf do runCmd s!"lake exe mdgen LeanByExample booksrc --count --copy" let outputConfig ← IO.FS.readFile "typst/pdf-output.json" From 532c7a7b3d8869eb51c9c9268a247431fb528be4 Mon Sep 17 00:00:00 2001 From: Seasawher <47292598+Seasawher@users.noreply.github.com> Date: Sun, 6 Sep 2026 23:59:30 +0900 Subject: [PATCH 2/2] =?UTF-8?q?concurrency=20group=20=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/link_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml index 02da947a..07b6dd17 100644 --- a/.github/workflows/link_check.yml +++ b/.github/workflows/link_check.yml @@ -12,7 +12,7 @@ on: # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: - group: "pages" + group: "link-check" cancel-in-progress: false jobs: