Debian Codegraph @

ansible_collections/community/general/tests/utils/shippable/sanity.sh

raw
1 #!/usr/bin/env bash
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 set -o pipefail -eux
7
8 declare -a args
9 IFS='/:' read -ra args <<< "$1"
10
11 group="${args[1]}"
12
13 if [ "${BASE_BRANCH:-}" ]; then
14 base_branch="origin/${BASE_BRANCH}"
15 else
16 base_branch=""
17 fi
18
19 case "${group}" in
20 1) options=(--skip-test pylint --skip-test ansible-doc --skip-test validate-modules) ;;
21 2) options=( --test ansible-doc --test validate-modules) ;;
22 3) options=(--test pylint plugins/modules/) ;;
23 4) options=(--test pylint --exclude plugins/modules/) ;;
24 esac
25
26 # shellcheck disable=SC2086
27 ansible-test sanity --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
28 --docker --base-branch "${base_branch}" \
29 "${options[@]}" --allow-disabled