Try using GitHub Action validator

This commit is contained in:
Dolan Miu
2021-09-30 00:19:03 +01:00
parent 97d1025a0f
commit d881646e73
4 changed files with 602 additions and 13 deletions

599
.github/workflows/schema-validator.yml vendored Normal file
View File

@ -0,0 +1,599 @@
name: Default
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: build
path: build
demos:
name: Run Demos and Validate
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: build
path: build
- name: Run Demo
run: npm run ts-node -- ./demo/1-basic.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/2-declaritive-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/3-numbering-and-bullet-points.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/4-basic-table.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/5-images.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/6-page-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/7-landscape.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/8-header-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/9-images-in-header-and-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/10-my-cv.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/11-declaritive-styles-2.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/12-scaling-images.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/13-xml-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/14-page-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/15-page-break-before.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/16-multiple-sections.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/17-footnotes.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/18-image-from-buffer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/19-export-to-base64.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/20-table-cell-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/21-bookmarks.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/22-right-to-left-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/23-base64-images.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/24-images-to-table-cell.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/25-table-xml-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/26-paragraph-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/27-declaritive-styles-3.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/28-table-of-contents.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/29-numbered-lists.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/30-template-document.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/31-tables.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/32-merge-and-shade-table-cells.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/33-sequential-captions.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/34-floating-tables.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/35-hyperlinks.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/36-image-to-table-cell.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/37-images-to-header-and-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/38-text-wrapping.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/39-page-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/40-line-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/41-merge-table-cells-2.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/42-restart-page-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/43-images-to-table-cell-2.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/44-multiple-columns.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/45-highlighting-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/46-shading-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/47-number-of-total-pages-section.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/48-vertical-align.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/49-table-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/50-readme-demo.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/51-character-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/52-japanese.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/53-chinese.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/54-custom-properties.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/55-math.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/56-background-color.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/57-add-parent-numbered-lists.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/58-section-types.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/59-header-footer-margins.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/60-track-revisions.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/61-text-frame.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/62-paragraph-spacing.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/63-odd-even-header-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/64-complex-numbering-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/65-page-sizes.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/66-fields.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/67-column-break.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/68-numbering-instances-and-starting-number.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/69-different-width-columns.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/70-line-numbers-suppression.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: scripts/schema-validator/schemas/microsoft/wml-2010.xsd

View File

@ -19,7 +19,7 @@
"fix-types": "ts-node scripts/types-absolute-fixer.ts", "fix-types": "ts-node scripts/types-absolute-fixer.ts",
"e2e": "ts-node scripts/e2e.ts", "e2e": "ts-node scripts/e2e.ts",
"serve.docs": "cd docs && docsify serve", "serve.docs": "cd docs && docsify serve",
"validate": "ts-node scripts/schema-validator", "extract": "ts-node scripts/schema-validator",
"ts-node": "ts-node --skip-project" "ts-node": "ts-node --skip-project"
}, },
"pre-commit": [ "pre-commit": [

View File

@ -1,2 +0,0 @@
work-area/
!work-area/.gitkeep

View File

@ -1,18 +1,10 @@
import * as fs from "fs";
import * as unzipper from "unzipper"; import * as unzipper from "unzipper";
import { validateXMLWithXSD } from "validate-with-xmllint";
const main = async () => { const main = async () => {
fs.copyFileSync("My Document.docx", "scripts/schema-validator/work-area/doc.zip"); const zip = await unzipper.Open.file("My Document.docx");
const zip = await unzipper.Open.file("scripts/schema-validator/work-area/doc.zip");
await zip.extract({ await zip.extract({
path: "scripts/schema-validator/work-area/doc", path: "build/extracted-doc",
}); });
const xml = fs.readFileSync("scripts/schema-validator/work-area/doc/word/document.xml", "ascii");
await validateXMLWithXSD(xml, "scripts/schema-validator/schemas/microsoft/wml-2010.xsd");
}; };
main(); main();