Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/junit-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check links
on:
pull_request:

jobs:
junit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Check links
id: lychee
uses: lycheeverse/lychee-action@v2
with:
fail: false
format: "junit"
lycheeVersion: "nightly"
args: "fixtures/JUNIT-DEMO.md"
output: "results.xml"

- name: Publish link check report
uses: mikepenz/action-junit-report@v6
with:
report_paths: "results.xml"
annotate_only: true
fail_on_failure: true
26 changes: 26 additions & 0 deletions fixtures/JUNIT-DEMO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Check file link
![Logo](../assets/banner.ssvg)

Check failure on line 2 in fixtures/JUNIT-DEMO.md

View workflow job for this annotation

GitHub Actions / junit

fixtures/JUNIT-DEMO.md.Failed file:///home/runner/work/lychee/lychee/assets/banner.ssvg

file:///home/runner/work/lychee/lychee/assets/banner.ssvg (at 2:1) | Cannot find file: File not found. Check if file exists and path is correct

![Fragment only link](#awesome)

Normal link, which should work as expected.
[Wikipedia](https://en.wikipedia.org/huhhh)

Check failure on line 7 in fixtures/JUNIT-DEMO.md

View workflow job for this annotation

GitHub Actions / junit

fixtures/JUNIT-DEMO.md.Failed https://en.wikipedia.org/huhhh

https://en.wikipedia.org/huhhh (at 7:1) | Rejected status code: 404 Not Found (configurable with "accept" option)

Just a normal link without any markup around it should work, too.
https://endler.dev/oh-no

Check failure on line 10 in fixtures/JUNIT-DEMO.md

View workflow job for this annotation

GitHub Actions / junit

fixtures/JUNIT-DEMO.md.Failed https://endler.dev/oh-no

https://endler.dev/oh-no (at 10:1) | Rejected status code: 404 Not Found (configurable with "accept" option)

Test GZIP compression. (See https://github.com/analysis-tools-dev/static-analysis/issues/350)
[LDRA](https://ldra.comm)

Check failure on line 13 in fixtures/JUNIT-DEMO.md

View workflow job for this annotation

GitHub Actions / junit

fixtures/JUNIT-DEMO.md.Failed https://ldra.comm/

https://ldra.comm/ (at 13:1) | Network error: Connection failed. Check network connectivity and firewall settings (error sending request for url (https://ldra.comm/)): Connection failed. Check network connectivity and firewall settings

Some more complex formatting to test that Markdown parsing works.
[![CC0](https://licensebuttons.net/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/)


Test HTTP and HTTPS for the same site.
http://example.com
https://example.com

http://thomaszahner.ch

test@example.com
mailto:test2@example.com
53 changes: 53 additions & 0 deletions results.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="lychee link check results" tests="13" failures="4" errors="0">
<testsuite name="lychee link check results" tests="13" disabled="4" errors="0" failures="4">
<testcase name="Failed https://endler.dev/oh-no" time="0.142" file="fixtures/JUNIT-DEMO.md" line="10">
<failure message="https://endler.dev/oh-no (at 10:1) | Rejected status code: 404 Not Found (configurable with &quot;accept&quot; option)"/>
<system-out>https://endler.dev/oh-no (at 10:1) | Rejected status code: 404 Not Found (configurable with &quot;accept&quot; option)</system-out>
</testcase>
<testcase name="Failed file:///home/thomas/Projects/lychee/assets/banner.ssvg" time="0.000" file="fixtures/JUNIT-DEMO.md" line="2">
<failure message="file:///home/thomas/Projects/lychee/assets/banner.ssvg (at 2:1) | Cannot find file: File not found. Check if file exists and path is correct"/>
<system-out>file:///home/thomas/Projects/lychee/assets/banner.ssvg (at 2:1) | Cannot find file: File not found. Check if file exists and path is correct</system-out>
</testcase>
<testcase name="Failed https://en.wikipedia.org/huhhh" time="0.200" file="fixtures/JUNIT-DEMO.md" line="7">
<failure message="https://en.wikipedia.org/huhhh (at 7:1) | Rejected status code: 404 Not Found (configurable with &quot;accept&quot; option)"/>
<system-out>https://en.wikipedia.org/huhhh (at 7:1) | Rejected status code: 404 Not Found (configurable with &quot;accept&quot; option)</system-out>
</testcase>
<testcase name="Failed https://ldra.comm/" time="0.011" file="fixtures/JUNIT-DEMO.md" line="13">
<failure message="https://ldra.comm/ (at 13:1) | Network error: Connection failed. Check network connectivity and firewall settings (error sending request for url (https://ldra.comm/)): Connection failed. Check network connectivity and firewall settings"/>
<system-out>https://ldra.comm/ (at 13:1) | Network error: Connection failed. Check network connectivity and firewall settings (error sending request for url (https://ldra.comm/)): Connection failed. Check network connectivity and firewall settings</system-out>
</testcase>
<testcase name="Excluded mailto:test@example.com" file="fixtures/JUNIT-DEMO.md" line="25">
<skipped message="mailto:test@example.com (at 25:1)"/>
<system-out>mailto:test@example.com (at 25:1)</system-out>
</testcase>
<testcase name="Excluded http://example.com/" file="fixtures/JUNIT-DEMO.md" line="20">
<skipped message="http://example.com/ (at 20:1)"/>
<system-out>http://example.com/ (at 20:1)</system-out>
</testcase>
<testcase name="Excluded mailto:test2@example.com" file="fixtures/JUNIT-DEMO.md" line="26">
<skipped message="mailto:test2@example.com (at 26:8)"/>
<system-out>mailto:test2@example.com (at 26:8)</system-out>
</testcase>
<testcase name="Excluded https://example.com/" file="fixtures/JUNIT-DEMO.md" line="21">
<skipped message="https://example.com/ (at 21:1)"/>
<system-out>https://example.com/ (at 21:1)</system-out>
</testcase>
<testcase name="Successful https://creativecommons.org/publicdomain/zero/1.0/" time="0.112" file="fixtures/JUNIT-DEMO.md" line="16">
<system-out>https://creativecommons.org/publicdomain/zero/1.0/ (at 16:1)</system-out>
</testcase>
<testcase name="Successful https://github.com/analysis-tools-dev/static-analysis/issues/350" time="0.852" file="fixtures/JUNIT-DEMO.md" line="12">
<system-out>https://github.com/analysis-tools-dev/static-analysis/issues/350 (at 12:29)</system-out>
</testcase>
<testcase name="Successful https://licensebuttons.net/p/zero/1.0/88x31.png" time="0.105" file="fixtures/JUNIT-DEMO.md" line="16">
<system-out>https://licensebuttons.net/p/zero/1.0/88x31.png (at 16:2)</system-out>
</testcase>
<testcase name="Successful file:///home/thomas/Projects/lychee/fixtures/JUNIT-DEMO.md#awesome" time="0.000" file="fixtures/JUNIT-DEMO.md" line="4">
<system-out>file:///home/thomas/Projects/lychee/fixtures/JUNIT-DEMO.md#awesome (at 4:1)</system-out>
</testcase>
<testcase name="Redirected http://thomaszahner.ch/" time="0.154" file="fixtures/JUNIT-DEMO.md" line="23">
<system-out>http://thomaszahner.ch/ (at 23:1) | Redirect: Followed 1 redirect resolving to the final status of: OK. Redirects: http://thomaszahner.ch/ --[301]--&gt; https://thomaszahner.ch/</system-out>
</testcase>
</testsuite>
</testsuites>

Loading