From 2e9e23e9082cdeeb2c4b785d71af44c9ce96a922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Tue, 19 Dec 2023 19:00:47 +0000 Subject: [PATCH] ci(docx): add 2 CI rules to run the validation rules from the Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Triggered only when the golden docx or the validator script changes. Signed-off-by: Edwin Török --- .github/workflows/docx-validation.yaml | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/docx-validation.yaml diff --git a/.github/workflows/docx-validation.yaml b/.github/workflows/docx-validation.yaml new file mode 100644 index 000000000000..7aee730d5ce2 --- /dev/null +++ b/.github/workflows/docx-validation.yaml @@ -0,0 +1,58 @@ +name: docx-validation +on: + push: + paths: + - test/docx/golden/*.docx + - tools/validate-docx.sh + - .github/workflows/docx-validation.yaml + pull_request: + paths: + - test/docx/golden/*.docx + - tools/validate-docx.sh + - .github/workflows/docx-validation.yaml + +permissions: + contents: read + +jobs: + xmllint-docx: + runs-on: ubuntu-latest + steps: + - name: Install xmllint + run: | + sudo apt-get update + sudo apt-get install libxml2-utils -y + + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: | + test/docx/golden + tools/ + Makefile + + - name: Validate golden .docx files against standard XML schema + run: make validate-docx-golden-tests + + dotnet-docx: + runs-on: ubuntu-latest + + steps: + - name: ensure dotnet is present + uses: actions/setup-dotnet@v4 + + - name: Install json_reformat + run: | + sudo apt-get update + sudo apt-get install yajl-tools -y + + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: | + test/docx/golden + tools/ + Makefile + + - name: Validate golden docx files using dotnet + run: make validate-docx-golden-tests2