Jelajahi Sumber

GitHub: Add check for Pack Description

Jonatan Antoni 4 tahun lalu
induk
melakukan
9c2c03c91c
2 mengubah file dengan 44 tambahan dan 0 penghapusan
  1. 28 0
      .github/workflows/packdesc.yml
  2. 16 0
      .github/xmllint.json

+ 28 - 0
.github/workflows/packdesc.yml

@@ -0,0 +1,28 @@
+name: Pack Description
+
+on:
+  pull_request:
+    branches: [ develop ]
+    paths:
+      - 'ARM.CMSIS.pdsc'
+
+permissions:
+  contents: read
+  pull-requests: write
+
+jobs:
+  check:
+    name: Check pack description schema
+    runs-on: ubuntu-latest
+    steps:
+    - name: Install xmllint
+      run: |
+        sudo apt-get install libxml2-utils
+    - name: Checkout repository
+      uses: actions/checkout@v2
+      with:
+        ref: ${{ github.event.pull_request.head.sha }}
+    - name: Run xmllint
+      run: |
+        curl https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/main/schema/PACK.xsd -o CMSIS/Utilities/PACK.xsd
+        xmllint --noout --schema "$(realpath -m ./CMSIS/Utilities/PACK.xsd)" "ARM.CMSIS.pdsc"

+ 16 - 0
.github/xmllint.json

@@ -0,0 +1,16 @@
+{
+	"problemMatcher": [
+		{
+			"owner": "fileheader",
+			"severity": "error",
+			"pattern": [
+				{
+					"regexp": "^(.*):(\\d+):(.*)$",
+					"file": 1,
+					"line": 2,
+					"message": 3
+				}
+			]
+		}
+	]
+}