Skip to content

Commit

Permalink
Checking UCRT64 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Jan 11, 2025
1 parent 3214ca1 commit 9c656d8
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 50 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,39 @@ on:

jobs:
Setup-GHDL-Nightly:
name: ${{ matrix.os.icon }} Setup GHDL on ${{ matrix.os.name }}
name: ${{ matrix.os.icon }} Setup GHDL ${{ matrix.os.backend }} on ${{ matrix.os.name }}
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
matrix:
os:
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'backend': 'mcode'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'backend': 'llvm'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'backend': 'llvm-jit'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'backend': 'gcc'}
- {'icon': '🍎', 'name': 'macOS', 'image': 'macos-13', 'shell': 'bash', 'backend': 'mcode'}
- {'icon': '🍏', 'name': 'macOS', 'image': 'macos-14', 'shell': 'bash', 'backend': 'llvm'}
- {'icon': '🪟', 'name': 'Windows', 'image': 'windows-2022', 'shell': 'bash', 'backend': 'mcode'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'runtime': '', 'backend': 'mcode'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'runtime': '', 'backend': 'llvm'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'runtime': '', 'backend': 'llvm-jit'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'shell': 'bash', 'runtime': '', 'backend': 'gcc'}
- {'icon': '🍎', 'name': 'macOS', 'image': 'macos-13', 'shell': 'bash', 'runtime': '', 'backend': 'mcode'}
- {'icon': '🍎', 'name': 'macOS', 'image': 'macos-13', 'shell': 'bash', 'runtime': '', 'backend': 'llvm'}
- {'icon': '🍏', 'name': 'macOS', 'image': 'macos-14', 'shell': 'bash', 'runtime': '', 'backend': 'llvm'}
- {'icon': '🪟', 'name': 'Windows', 'image': 'windows-2022', 'shell': 'powershell','runtime': '', 'backend': 'mcode'}
- {'icon': '🪟', 'name': 'Windows', 'image': 'windows-2022', 'shell': 'msys2 {0}', 'runtime': 'ucrt64', 'backend': 'mcode'}
defaults:
run:
shell: ${{ matrix.os.shell }}

steps:
- name: Setup GHDL
- name: 🟦 Setup MSYS2 for ${{ matrix.os.runtime }}
uses: msys2/setup-msys2@v2
if: startsWith(matrix.os.shell, 'msys2')
with:
msystem: ${{ matrix.os.runtime }}
update: true

- name: Setup GHDL ${{ matrix.os.backend }}
uses: paebbels/setup-ghdl@dev
with:
version: nightly
backend: ${{ matrix.os.backend }}
runtime: ${{ matrix.os.runtime }}
investigate: true

- name: Verify
Expand Down
82 changes: 41 additions & 41 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ inputs:
type: string
required: false
default: 'mcode'
runtime:
type: string
required: false
default: ''
install-directory:
type: string
required: false
Expand Down Expand Up @@ -113,14 +117,24 @@ runs:
printf "Writing step outputs 'xxx' ...\n"
- name: Download and install GHDL on macOS x86-64
- name: Download and install GHDL on macOS (${{ runner.arch }})
id: macOSIntel
if: runner.os == 'macOS' && runner.arch == 'X64'
if: runner.os == 'macOS' && ( runner.arch == 'X64' || runner.arch == 'ARM64' )
shell: bash
run: |
# TODO: check macOS version
OS_RELEASE=13
# TODO: check macOS version
if [[ "${{ runner.arch }}" == "X64" ]]; then
OS_RELEASE=13
OS_ARCH=x86_64
elif [[ "${{ runner.arch }}" == "ARM64" ]]; then
OS_RELEASE=14
OS_ARCH=aarch64
else
printf "::error title=%s::%s\n" "setup-ghdl" "Unsupported macOS architecture '${{ runner.arch }}'."
exit 1
fi
printf "macOS: macOS %s - %s\n" "${OS_RELEASE}" "${OS_ARCH//_/-}"
if [[ "${{ inputs.version }}" == "nightly" ]]; then
VERSION_IN_URL="nightly"
Expand All @@ -137,11 +151,11 @@ runs:
exit 1
fi
if [[ "${{ inputs.backend }}" != "mcode" ]]; then
if [[ "${{ inputs.backend }}" =~ ^mcode|llvm(-jit)?$ ]]; then
printf "Backend: %s\n" "${{ inputs.backend }}"
else
printf "::error title=%s::%s\n" "setup-ghdl" "Unsupported GHDL backend '${{ inputs.backend }}'."
exit 1
else
printf "Backend: %s\n" "${{ inputs.backend }}"
fi
(
Expand All @@ -150,7 +164,7 @@ runs:
cd "${{ inputs.install-directory }}"
printf "Downloading asset and extracting tar.gz file ...\n"
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/ghdl-${{ inputs.backend }}-${VERSION_IN_FILE}-macos${OS_RELEASE}-x86_64.tar.gz" | tar -xz --strip-components 1
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/ghdl-${{ inputs.backend }}-${VERSION_IN_FILE}-macos${OS_RELEASE}-${OS_ARCH}.tar.gz" | tar -xz --strip-components 1
(
cd bin
pwd
Expand All @@ -170,15 +184,19 @@ runs:
printf "Writing step outputs 'xxx' ...\n"
- name: Download and install GHDL on macOS aarch64
id: macOSArm
if: runner.os == 'macOS' && runner.arch == 'ARM64'
shell: bash
- name: Download and install GHDL on Windows (native)
id: Windows
if: runner.os == 'Windows' && runner.arch == 'X64' && inputs.runtime == ''
shell: powershell
run: |
# TODO: check macOS version
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/mingw-w64-ucrt-x86_64-ghdl-mcode-5.0.0.dev-1-any.pkg.tar.zst" -o ghdl.pkg.tar.zst
OS_RELEASE=14
- name: Download and install GHDL on Windows + UCRT64 (x86-64)
id: UCRT64
if: runner.os == 'Windows' && runner.arch == 'X64' && ( inputs.runtime == 'mingw64' || inputs.runtime == 'ucrt64' )
shell: ${{ inputs.shell }}
run: |
if [[ "${{ inputs.version }}" == "nightly" ]]; then
VERSION_IN_URL="nightly"
VERSION_IN_FILE="${{ steps.variables.outputs.nightly-version }}"
Expand All @@ -194,35 +212,17 @@ runs:
exit 1
fi
if [[ "${{ inputs.backend }}" != "llvm" ]]; then
if [[ "${{ inputs.backend }}" =~ ^mcode|llvm(-jit)?$ ]]; then
printf "Backend: %s\n" "${{ inputs.backend }}"
else
printf "::error title=%s::%s\n" "setup-ghdl" "Unsupported GHDL backend '${{ inputs.backend }}'."
exit 1
else
printf "Backend: %s\n" "${{ inputs.backend }}"
fi
(
printf "Creating installation directory '${{ inputs.install-directory }}' ...\n"
mkdir -p "${{ inputs.install-directory }}"
cd "${{ inputs.install-directory }}"
printf "Downloading asset and extracting tar.gz file ...\n"
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/ghdl-${{ inputs.backend }}-${VERSION_IN_FILE}-macos${OS_RELEASE}-aarch64.tar.gz" | tar -xz --strip-components 1
(
cd bin
pwd
ls -lAh .
)
)
printf "Setting environment variable 'GHDL_PREFIX' ...\n"
tee "${GITHUB_ENV}" <<EOF
GHDL_PREFIX=$(pwd)/${{ inputs.install-directory }}/lib/ghdl
EOF
printf "Adding GHDL to 'PATH' ...\n"
tee "${GITHUB_PATH}" <<EOF
$(pwd)/${{ inputs.install-directory }}/bin
EOF
curl -L "https://github.com/ghdl/ghdl/releases/download/${VERSION_IN_URL}/mingw-w64-ucrt-x86_64-ghdl-mcode-5.0.0.dev-1-any.pkg.tar.zst" -o ghdl.pkg.tar.zst
pacman -U --noconfirm ghdl.pkg.tar.zst
printf "Writing step outputs 'xxx' ...\n"
which ghdl
ghdl version
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl) >> $GITHUB_ENV"
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl)" >> $GITHUB_ENV

0 comments on commit 9c656d8

Please sign in to comment.