Skip to content

Commit

Permalink
Add PASSWORDLESS option to macOS test.
Browse files Browse the repository at this point in the history
  • Loading branch information
actapia committed Nov 24, 2024
1 parent e00d6f3 commit 7164fbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-install-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Test installation
run: zsh tests/test_install/macos.sh "$GITHUB_REF_NAME"
run: PASSWORDLESS=1 zsh tests/test_install/macos.sh "$GITHUB_REF_NAME"

15 changes: 10 additions & 5 deletions tests/test_install/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ fi
if [ "$#" -eq 1 ]; then
branch="$1"
fi
if which sudo && ! sudo -n -v; then
read -rs "password?Password: "
while ! echo "$password" | sudo -S -v 2>/dev/null; do
if [ -z "$PASSWORDLESS" ]; then
PASSWORDLESS=0
fi
if which sudo; then
if [ "$PASSWORDLESS" -ne 1 ] && ! sudo -n -v; then
read -rs "password?Password: "
done
while ! echo "$password" | sudo -S -v 2>/dev/null; do
read -rs "password?Password: "
done
fi
else
function sudo {
"$@"
Expand Down Expand Up @@ -78,7 +83,7 @@ if which sudo && ! sudo -n -v; then
fi
CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install bash blast cpanminus
if which sudo; then
if [ "$PASSWORDLESS" -ne 1 ] && which sudo; then
echo "$password" | startsudo
fi
sudo cpanm Bio::SeqIO
Expand Down

0 comments on commit 7164fbb

Please sign in to comment.