06_script.sh raw

   1  #!/usr/bin/env bash
   2  #
   3  # Copyright (c) 2018-present The Limenka developers
   4  # Distributed under the MIT software license, see the accompanying
   5  # file COPYING or http://www.opensource.org/licenses/mit-license.php.
   6  
   7  export LC_ALL=C
   8  
   9  set -ex
  10  
  11  if [ -n "$CIRRUS_PR" ]; then
  12    export COMMIT_RANGE="HEAD~..HEAD"
  13    if [ "$(git rev-list -1 HEAD)" != "$(git rev-list -1 --merges HEAD)" ]; then
  14      echo "Error: The top commit must be a merge commit, usually the remote 'pull/${PR_NUMBER}/merge' branch."
  15      false
  16    fi
  17  fi
  18  
  19  RUST_BACKTRACE=1 "${LINT_RUNNER_PATH}/test_runner"
  20  
  21  if [ "$CIRRUS_REPO_FULL_NAME" = "limenka/limenka" ] && [ "$CIRRUS_PR" = "" ] ; then
  22      # Sanity check only the last few commits to get notified of missing sigs,
  23      # missing keys, or expired keys. Usually there is only one new merge commit
  24      # per push on the master branch and a few commits on release branches, so
  25      # sanity checking only a few (10) commits seems sufficient and cheap.
  26      git log HEAD~10 -1 --format='%H' > ./contrib/verify-commits/trusted-sha512-root-commit
  27      git log HEAD~10 -1 --format='%H' > ./contrib/verify-commits/trusted-git-root
  28      mapfile -t KEYS < contrib/verify-commits/trusted-keys
  29      git config user.email "ci@ci.ci"
  30      git config user.name "ci"
  31      ${CI_RETRY_EXE} gpg --keyserver hkps://keys.openpgp.org --recv-keys "${KEYS[@]}" &&
  32      ./contrib/verify-commits/verify-commits.py;
  33  fi
  34