From 862952c30e31c54bc4478bf2aebc06722dc834d1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 10 Jul 2020 17:06:36 +0200 Subject: [PATCH 1/2] Validate the info.xml with a github workflow Signed-off-by: Joas Schilling --- .github/workflows/lint.yml | 13 +++++++++++++ .travis.yml | 3 --- tests/scripts/lint-appinfo.sh | 13 ------------- 3 files changed, 13 insertions(+), 16 deletions(-) delete mode 100755 tests/scripts/lint-appinfo.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1785317..849e48d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -43,3 +43,16 @@ jobs: run: composer i - name: Run coding standards check run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) + + xml-linters: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + - name: Download schema + run: wget https://apps.nextcloud.com/schema/apps/info.xsd + - name: Lint info.xml + uses: ChristophWurst/xmllint-action@v1 + with: + xml-file: ./appinfo/info.xml + xml-schema-file: ./info.xsd diff --git a/.travis.yml b/.travis.yml index 5ba3c07..f5e7b82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,9 +57,6 @@ install: - . ${BUILD_APP_MODULE_DIR}/tests/scripts/core-setup.sh script: - # Check info.xml schema validity - - . ${BUILD_APP_MODULE_DIR}/tests/scripts/lint-appinfo.sh - # Check PHP syntax errors - . ${BUILD_APP_MODULE_DIR}/tests/scripts/lint-php.sh diff --git a/tests/scripts/lint-appinfo.sh b/tests/scripts/lint-appinfo.sh deleted file mode 100755 index 89fb3c1..0000000 --- a/tests/scripts/lint-appinfo.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -echo "travis_fold:start:lint.appinfo" - -set -e - -cd ${BUILD_APP_MODULE_DIR} - -wget -nv https://apps.nextcloud.com/schema/apps/info.xsd -xmllint appinfo/info.xml --schema info.xsd --noout -rm info.xsd - -echo "travis_fold:end:lint.appinfo" From df915c375b722c2f556cbee525632002049e682a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 10 Jul 2020 17:17:45 +0200 Subject: [PATCH 2/2] Linting is also done via github workflows already Signed-off-by: Joas Schilling --- .travis.yml | 3 --- tests/scripts/lint-php.sh | 11 ----------- 2 files changed, 14 deletions(-) delete mode 100755 tests/scripts/lint-php.sh diff --git a/.travis.yml b/.travis.yml index f5e7b82..3a1c7b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,9 +57,6 @@ install: - . ${BUILD_APP_MODULE_DIR}/tests/scripts/core-setup.sh script: - # Check PHP syntax errors - - . ${BUILD_APP_MODULE_DIR}/tests/scripts/lint-php.sh - # Run app code checker but do not fail, as we have to use private API for now - . ${BUILD_APP_MODULE_DIR}/tests/scripts/app-check-code.sh || true diff --git a/tests/scripts/lint-php.sh b/tests/scripts/lint-php.sh deleted file mode 100755 index afa2a6e..0000000 --- a/tests/scripts/lint-php.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -echo "travis_fold:start:lint.php" - -set -e - -cd ${BUILD_APP_MODULE_DIR} - -find . -name '*.php' -type f -not -path './vendor/*' -print0 | xargs --no-run-if-empty -0 -n1 -P8 php -l -d display_errors -d display_startup_errors 1>/dev/null - -echo "travis_fold:end:lint.php"