Skip to content

Commit 059d630

Browse files
committed
create xmllint-problem-matcher
1 parent 694f78c commit 059d630

File tree

8 files changed

+801
-0
lines changed

8 files changed

+801
-0
lines changed

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
- name: Setup xmllint
15+
run: sudo apt-get install --no-install-recommends -y libxml2-utils
16+
- name: add problem matcher for xmllint
17+
run: ./index.js
18+
- name: lint XML file with syntax error
19+
run: xmllint test/error.xml --schema test/info.xsd --noout || true
20+
- name: lint XML file with schema error
21+
run: xmllint test/info.xml --schema test/info.xsd --noout || true
22+

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# xmllint-problem-matcher
2+
3+
This problem matcher lets you show errors from `xmllint` as annotation in GitHub Actions.
4+
5+
## Usage
6+
7+
Add the step to your workflow, before PHPUnit is called.
8+
9+
```yaml
10+
- uses: korelstar/xmllint-problem-matcher@v1
11+
```

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'xmllint problem matcher'
2+
author: 'Kristof Hamann'
3+
description: 'Shows xmllint errors as annotation (with file and code line) in GitHub Actions'
4+
runs:
5+
using: 'node12'
6+
main: 'index.js'
7+
branding:
8+
icon: 'check-square'
9+
color: 'green'

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
console.log(`::add-matcher::${__dirname}/xmllint-matcher.json`);

test/error.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="info.xsd">
4+
<idi>uniqueid</id>
5+
<name attribut="test">App name</name>
6+
</summary>This is for test</summary>
7+
<description><![CDATA[
8+
Let's describe something
9+
]]></description>
10+
<licence>agpl</licence>
11+
<version>1.4</version>
12+
</info>

test/info.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="info.xsd">
4+
<id>testid</id>
5+
<name attribut="test">App</name>
6+
<summary>This is a summary</summary>
7+
<description><![CDATA[
8+
Let's describe something.
9+
]]></description>
10+
<licence>agpl</licence>
11+
<version>1.4</version>
12+
</info>

0 commit comments

Comments
 (0)