ci: install updated bash on macOS platforms via workflow
authorVincent Fu <vincent.fu@samsung.com>
Tue, 27 Aug 2024 14:37:02 +0000 (14:37 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Tue, 27 Aug 2024 14:51:38 +0000 (14:51 +0000)
Our shell script for installing dependencies uses a feature that is only
available starting with bash 4. macOS ships with bash 3, so install bash
from homebrew in the GitHub Actions workflow when runing on macOS.
Previously we could install bash in our shell script for installing
dependencies but this depedencies install script now needs the bash 4
feature.

The feature in question is for bash to be able to match multiple
patterns in a case statement.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
.github/workflows/ci.yml
ci/actions-install.sh

index 1601aa9ebbe1ae35b2eedf4904389c2403135ab1..52df37127d150d138f80592e85d15ba6dfb46ed7 100644 (file)
@@ -127,6 +127,9 @@ jobs:
           mingw-w64-${{matrix.arch}}-python-statsmodels
           mingw-w64-${{matrix.arch}}-python-sphinx
 
+    - name: install bash 4 (macOS)
+      if: ${{ contains( matrix.build, 'macOS' ) }}
+      run:  HOMEBREW_NO_AUTO_UPDATE=1 brew install bash
     - name: Install dependencies
       run: ${{matrix.shell}} ./ci/actions-install.sh
       if: ${{ !contains( matrix.build, 'msys2' ) }}
index 38d39de933a2067d752bf6ba9f3ee916d82c87b6..db3aa0f3031c52ccd51c1913483c87407516a7f7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # This script expects to be invoked from the base fio directory.
 set -eu
 
@@ -145,7 +145,7 @@ install_macos() {
     #echo "Updating homebrew..."
     #brew update >/dev/null 2>&1
     echo "Installing packages..."
-    HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs bash
+    HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs
     pip3 install scipy six statsmodels sphinx
 }