From 04fcaaaad2c42feabe0863ab03866b74183e4fbb Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Fri, 7 Aug 2020 11:39:32 +0200 Subject: [PATCH] Add XML linting to GitHub CI --- .github/workflows/ci.yaml | 44 +++++++++++++++++++- Resources/Private/Language/locallang.xlf | 6 +-- Resources/Private/Language/locallang_tca.xlf | 6 +-- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 092eb49..d2ccfa3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,9 +33,47 @@ jobs: - name: Missing composer requirements run: ./vendor/bin/composer-require-checker + xml-linting: + runs-on: ubuntu-latest + needs: [check-composer] + steps: + - uses: actions/checkout@v2 + + - name: Install xmllint + run: sudo apt-get install libxml2-utils + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: PHPUnit configuration file + run: xmllint --schema vendor/phpunit/phpunit/schema/9.3.xsd --noout phpunit.xml.dist + + - name: PHPCodeSniffer configuration file + run: xmllint --schema vendor/squizlabs/php_codesniffer/phpcs.xsd --noout phpcs.xml.dist + + - name: Fetch schema for xliff + run: wget https://raw.githubusercontent.com/TYPO3-Documentation/tea/master/.github/build/xliff-core-1.2-strict.xsd --output-document=.Build/xliff-core-1.2.xsd + + - name: TYPO3 language files + run: xmllint --schema .Build/xliff-core-1.2.xsd --noout $(find Resources -name '*.xlf') + coding-guideline: runs-on: ubuntu-latest - needs: [check-dependencies] + needs: + - check-dependencies + - xml-linting steps: - uses: actions/checkout@v2 @@ -59,7 +97,9 @@ jobs: tests: runs-on: ubuntu-latest - needs: [check-dependencies] + needs: + - check-dependencies + - xml-linting steps: - uses: actions/checkout@v2 diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 476b371..a71d41e 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/locallang_tca.xlf b/Resources/Private/Language/locallang_tca.xlf index 64418c4..4043044 100644 --- a/Resources/Private/Language/locallang_tca.xlf +++ b/Resources/Private/Language/locallang_tca.xlf @@ -1,6 +1,6 @@ - - - + + +