Skip to content

Commit

Permalink
Detect correct shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Jan 16, 2025
1 parent e56e95c commit 79d5b2e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:
- name: Verify on Linux or macOS
if: matrix.name == 'Ubuntu' || matrix.name == 'macOS'
run: |
printf "%s\n" "${PATH}"
which ghdl
ghdl --version
Expand Down
24 changes: 21 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,28 @@ inputs:
runs:
using: composite
steps:
- name: Detect correct shell
id: shell
shell: bash
run: |
# Detect correct shell
if [[ "${{ runner.os }}" == "Windows" && "${{ inputs.runtime }}" != "" ]]; then
printf "shell=msys2 {0}" >> $GITHUB_OUTPUT
else
printf "shell=bash" >> $GITHUB_OUTPUT
fi
- name: Update Bash on macOS
if: runner.os == 'macOS'
shell: bash
run: |
# Update Bash on macOS
brew install bash
- name: Download and install GHDL
id: generic
if: runner.os == 'Linux' || runner.os == 'macOS' || ( runner.os == 'Windows' && inputs.runtime != '' )
shell: bash
shell: ${{ steps.shell.outputs.shell }}
run: |
# Download and install GHDL
ANSI_LIGHT_RED=$'\x1b[91m'
Expand Down Expand Up @@ -105,15 +117,21 @@ runs:
fi
if [[ "${{ inputs.runtime }}" == "mingw64" ]]; then
osRuntime="mingw64"
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Installing 'jq' file ..."
pacman -S --noconfirm mingw64/mingw-w64-x86_64-jq
printf "::endgroup::\n"
elif [[ "${{ inputs.runtime }}" == "ucrt64" ]]; then
osRuntime="ucrt4"
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Installing 'jq' file ..."
pacman -S --noconfirm ucrt64/mingw-w64-ucrt-x86_64-jq
printf "::endgroup::\n"
else
printf "::error title=%s::%s\n" "setup-ghdl" "Unsupported MSYS 2 runtime '${{ inputs.runtime }}'."
exit 1
fi
cmd /c ver
osName="Windows"
osMajorVersion="2022"
osArchitecture="x86-64"
Expand Down

0 comments on commit 79d5b2e

Please sign in to comment.