From 378b2482d199e057caf5861c646f7347a17dfde0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 14 May 2021 21:42:57 +0200 Subject: [PATCH] [ticket/16775] Run xo linter in GitHub Actions runs PHPBB3-16775 --- .github/check-js.sh | 20 ++++++++++++++++++++ .github/workflows/tests.yml | 4 ++++ 2 files changed, 24 insertions(+) create mode 100755 .github/check-js.sh diff --git a/.github/check-js.sh b/.github/check-js.sh new file mode 100755 index 0000000000..891c5182ac --- /dev/null +++ b/.github/check-js.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# This file is part of the phpBB Forum Software package. +# +# @copyright (c) phpBB Limited +# @license GNU General Public License, version 2 (GPL-2.0) +# +# For full copyright and license information, please see +# the docs/CREDITS.txt file. +# +set -e +set +x + +sudo npm install -g > /dev/null +npm ci > /dev/null +set -x +node_modules/xo/cli.js "phpBB/adm/style/*.js" +node_modules/xo/cli.js "phpBB/assets/javascript/*.js" +node_modules/xo/cli.js "phpBB/style/all/js/*.js" +node_modules/xo/cli.js "phpBB/style/prosilver/template/*.js" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa6f2957ad..de5c8dbdb4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,6 +84,10 @@ jobs: run: | .github/check-stylesheet.sh + - name: Lint JavaScript files + run: | + .github/check-js.sh + - name: Check commit message if: github.event_name == 'pull_request' run: |