ci: Run eslint via tox

With GitHub Actions, we can now easily install tox *and* eslint in the same
environment.
This commit is contained in:
Florian Bruhin 2020-07-02 16:28:17 +02:00
parent 491fc4a35a
commit 75b4a069cb
3 changed files with 10 additions and 27 deletions

View File

@ -24,25 +24,15 @@ pip_install() {
python3 -m pip install "$@"
}
if [[ -n $DOCKER ]]; then
exit 0
fi
testenv=$1
case $testenv in
eslint)
npm install -g eslint
;;
shellcheck)
;;
*)
pip_install -U pip
pip_install -U -r misc/requirements/requirements-tox.txt
if [[ $testenv == docs ]]; then
sudo apt install asciidoc
elif [[ $testenv == *-cov ]]; then
pip_install -U -r misc/requirements/requirements-codecov.txt
fi
;;
esac
[[ -n $DOCKER || $testenv == shellcheck ]] && exit 0
[[ $testenv == eslint ]] && npm install -g eslint
pip_install -U pip
pip_install -U -r misc/requirements/requirements-tox.txt
[[ $testenv == docs ]] && sudo apt install asciidoc
[[ $testenv == *-cov ]] && pip_install -U -r misc/requirements/requirements-codecov.txt
exit 0

View File

@ -29,11 +29,6 @@ if [[ -n $DOCKER ]]; then
-e "DOCKER=$DOCKER" \
-e "CI=$CI" \
"qutebrowser/ci:$DOCKER"
elif [[ $testenv == eslint ]]; then
# Can't run this via tox as we can't easily install tox in the javascript
# travis env
cd qutebrowser/javascript || exit 1
eslint --color --report-unused-disable-directives .
elif [[ $testenv == shellcheck ]]; then
script_list=$(mktemp)
find scripts/dev/ -name '*.sh' > "$script_list"

View File

@ -180,8 +180,6 @@ deps = {[testenv:pyinstaller]deps}
commands = {[testenv:pyinstaller]commands}
[testenv:eslint]
# This is duplicated in travis_run.sh for Travis CI because we can't get tox in
# the JavaScript environment easily.
basepython = python3
deps =
passenv = TERM