-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mdbook linkcheck #523
mdbook linkcheck #523
Conversation
jeckersb
commented
May 13, 2024
- ci/docs: Add mdbook-linkcheck
- docs: fix mdbook-linkcheck errors/warnings
It occurs to me immediately that the docs workflow only triggers on push currently, so this won't actually run until after merges. So will require a bit of tweaking still since we want this to catch link bugs during review. |
@jeckersb I was tinkering on this as well...I think I have something nearly working here - miabbott@46d00fa Feel free to borrow anything from that |
Please ignore rhel 9.4 integration test failure. The new |
dfeb96b
to
5de9bde
Compare
Fixes containers#521 Signed-off-by: John Eckersberg <jeckersb@redhat.com>
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
5de9bde
to
ee78e9e
Compare
Alright I think this is doing the right thing and is ready for review now. I initially tried to make the mdbook setup bits into a reusable workflow, but that didn't quite work and I think what we would really want to share that code is a reusable action. But the github docs seem to imply that the action would need to live by itself in its own repository, which seems like more trouble than it's worth. So at least for now I've elected to go the copy/paste code duplication route. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
@jeckersb how about modifying diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1a04ff0..57968a8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -144,7 +144,7 @@ jobs:
- name: Integration tests
run: |
set -xeuo pipefail
- image=quay.io/centos-bootc/centos-bootc-dev:stream9
+ image=quay.io/centos-bootc/centos-bootc-dev:stream9
echo 'ssh-ed25519 ABC0123 testcase@example.com' > test_authorized_keys
sudo podman run --rm --privileged -v ./test_authorized_keys:/test_authorized_keys --env RUST_LOG=debug -v /:/target -v /var/lib/containers:/var/lib/containers -v ./usr/bin/bootc:/usr/bin/bootc --pid=host --security-opt label=disable \
${image} bootc install to-filesystem --acknowledge-destructive \
@@ -199,34 +199,3 @@ jobs:
truncate -s 20G ${tmpdisk}
sudo podman run --rm --privileged --env RUST_LOG=debug -v /dev:/dev -v /:/target -v /var/lib/containers:/var/lib/containers -v ./usr/bin/bootc:/usr/bin/bootc --pid=host --security-opt label=disable \
-v ${tmpdisk}:/disk ${image} bootc install to-disk --via-loopback /disk
- docs:
- if: ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
- runs-on: ubuntu-latest
- env:
- MDBOOK_VERSION: 0.4.37
- steps:
- - uses: actions/checkout@v4
- - name: Install mdBook
- run: |
- tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
- url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
- mkdir mdbook
- curl -sSL $url | tar -xz --directory=./mdbook
- echo `pwd`/mdbook >> $GITHUB_PATH
- - name: Install mdbook-mermaid
- run: |
- tag=$(curl 'https://api.github.com/repos/badboy/mdbook-mermaid/releases/latest' | jq -r '.tag_name')
- url="https://github.com/badboy/mdbook-mermaid/releases/download/${tag}/mdbook-mermaid-${tag}-x86_64-unknown-linux-gnu.tar.gz"
- mkdir mdbook-mermaid
- curl -sSL $url | tar -xz --directory=./mdbook-mermaid
- echo `pwd`/mdbook-mermaid >> $GITHUB_PATH
- - name: Install mdbook-linkcheck
- run: |
- tag=$(curl 'https://api.github.com/repos/Michael-F-Bryan/mdbook-linkcheck/releases/latest' | jq -r '.tag_name')
- archive="mdbook-linkcheck.x86_64-unknown-linux-gnu.zip"
- url="https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/${tag}/${archive}"
- mkdir mdbook-linkcheck
- curl -sSL -O $url && unzip ${archive} -d ./mdbook-linkcheck && chmod +x ./mdbook-linkcheck/mdbook-linkcheck
- echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
- - name: Build with mdBook
- run: cd docs && mdbook-mermaid install && mdbook build
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index a7f210f..a0caa44 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -3,6 +3,8 @@ name: Deploy docs to pages
on:
push:
branches: ["main"]
+ pull_request:
+ branches: [main]
workflow_dispatch:
permissions:
@@ -16,6 +18,7 @@ concurrency:
jobs:
build:
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.37 Edit: needs another |