From 4d7e4796d42ba71e22aed8981ea00c270b76e779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 13 Aug 2018 16:21:28 +0200 Subject: [PATCH] check python code --- ci/deploy.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index 1a94450c6..14943d305 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash -set -x -eu -o pipefail # Exit with nonzero exit code if anything fails +set -eu -o pipefail # Exit with nonzero exit code if anything fails -if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]] || [[ "$TRAVIS_EVENT_TYPE" == "api" ]]; then +is-automatic-update() { + [[ "$TRAVIS_EVENT_TYPE" == "cron" ]] || [[ "$TRAVIS_EVENT_TYPE" == "api" ]] +} + +if is-automatic-update; then keys_dir=$(mktemp -d) openssl aes-256-cbc \ -K $encrypted_080f214a372c_key \ @@ -33,8 +37,15 @@ fi result/bin/nur update nix-build -# Pull requests and commits to other branches shouldn't try to deploy, just build to verify -if [[ "$TRAVIS_EVENT_TYPE" != "cron" ]] && [[ "$TRAVIS_EVENT_TYPE" != "api" ]]; then +if ! is-automatic-update; then + # Type checker + nix run nixpkgs.python3Packages.mypy -c mypy nur + # Format checker + nix run nixpkgs.python3Packages.black -c black --check . + # Linter + nix run nixpkgs.python3Packages.flake8 -c flake8 . + + # Pull requests and commits to other branches shouldn't try to deploy, just build to verify echo "Skipping deploy; just doing a build." exit 0 fi