Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add csh shell test for installation workflow #1549

Merged
merged 9 commits into from
Jul 1, 2024
27 changes: 13 additions & 14 deletions .github/workflows/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,36 @@
with:
python-version: ${{ matrix.python-version }}

- name: "Install Zsh and Tcsh"
- name: "Install zsh and tcsh"
run: |
if [[ ${{ matrix.os }} == 'ubuntu-latest' ]]; then
sudo apt-get install -y tcsh zsh
else
brew install tcsh zsh
fi
- name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - bash

Check warning on line 34 in .github/workflows/installation.yml

View workflow job for this annotation

GitHub Actions / style_checks

34:81 [line-length] line too long (121 > 80 characters)
env:
OS: '${{ matrix.os }}'
shell: bash
run: |
echo "$SHELL"
run: |
echo $SHELL
pip install -U pip
source setup.sh
which buildtest
buildtest --help

- name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - zsh

Check warning on line 43 in .github/workflows/installation.yml

View workflow job for this annotation

GitHub Actions / style_checks

43:81 [line-length] line too long (120 > 80 characters)
env:
OS: '${{ matrix.os }}'
shell: zsh {0}
run: |
echo "$SHELL"
run: |
echo $SHELL
pip install -U pip
source setup.sh
which buildtest
buildtest --help

- uses: actions/checkout@v4
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
- name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - csh

Check warning on line 52 in .github/workflows/installation.yml

View workflow job for this annotation

GitHub Actions / style_checks

52:81 [line-length] line too long (120 > 80 characters)
shell: csh {0}
run: |
echo $shell
pip install -U pip
source setup.csh
which buildtest
buildtest --help
7 changes: 5 additions & 2 deletions setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# Get the name of the current shell
set shell_name = `ps -p $$ -o comm=`

# if shell is not csh or tcsh exit
if (`basename "$SHELL"` != "csh" && `basename "$SHELL"` != "tcsh") then
if (`basename $shell_name` != "csh" && `basename $shell_name` != "tcsh") then
echo "Unsupported shell, please use 'csh' or 'tcsh' when sourcing this script"
exit 1
endif
Expand Down Expand Up @@ -68,7 +71,7 @@ curl https://bootstrap.pypa.io/get-pip.py | $python

set pip=pip3

if ( ! -x `command -v $pip` ) then
if ( ! -x `which $pip` ) then
# If not found in PATH, check $HOME/.local/bin
if ( -x "$HOME/.local/bin/$pip" ) then
echo "$pip found in $HOME/.local/bin"
Expand Down
Loading