diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aed32d85..aaf35bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,6 +107,11 @@ jobs: name: License Check uses: ./.github/workflows/license_check.yml + # link-check is cheap (seconds) and should run on every PR + link-check: + name: Link Check + uses: ./.github/workflows/link_check.yml + cpp-checks: name: C++ Checks needs: changes @@ -141,6 +146,7 @@ jobs: - license-check - cpp-checks - generate-docs + - link-check - rust-release-check if: always() steps: diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml new file mode 100644 index 00000000..04c45386 --- /dev/null +++ b/.github/workflows/link_check.yml @@ -0,0 +1,39 @@ +name: Link Check + +# Validates docs.livekit.io and other URLs referenced in public headers and +# hand-written documentation. Modeled on livekit/client-sdk-esp32 link_check.yml. +on: + workflow_call: {} + workflow_dispatch: {} + +jobs: + check-links: + name: Link Check + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + + - name: Restore lychee cache + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + + - name: Run lychee + uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0 + with: + args: >- + --verbose + --no-progress + --cache + --max-cache-age 1d + --root-dir . + 'include/livekit/**/*.h' + 'docs/**/*.md' + README.md + fail: true + jobSummary: false diff --git a/.gitignore b/.gitignore index c7fabe11..19fb124b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .cache/ +.lycheecache CMakeFiles/ CMakeCache.txt .DS_Store diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000..26012769 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,12 @@ +# Local/dev-only URLs. +http://localhost:* +https://localhost:* +ws://localhost:* +wss://localhost:* + +# Ecosystem footer links that reject automated checks (403/405) but work in browsers. +https://docs.livekit.io/mcp +https://livekit.io/join-slack +https://livekit.com/join-slack +https://join.slack.com/* +https://livekit-users.slack.com/* diff --git a/docs/logging.md b/docs/logging.md index 1889479c..c1dab988 100644 --- a/docs/logging.md +++ b/docs/logging.md @@ -67,7 +67,7 @@ livekit::setLogCallback( livekit::setLogCallback(nullptr); ``` -See the [`logging_levels/custom_sinks.cpp`](https://github.com/livekit-examples/cpp-example-collection/blob/main/logging_levels/custom_sinks.cpp) +See the [`logging_levels/custom_sinks`](https://github.com/livekit-examples/cpp-example-collection/tree/main/logging_levels/custom_sinks) example for three copy-paste-ready patterns: a **file logger**, **JSON structured lines**, and a **ROS2 bridge** that maps `LogLevel` to `RCLCPP_*` macros.