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

v1.1.1 #8

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 88 additions & 41 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,68 +22,115 @@ on:

jobs:
Setup-GHDL-Nightly:
name: ${{ matrix.icon }} Setup GHDL ${{ matrix.backend }} on ${{ matrix.name }}
runs-on: ${{ matrix.image }}
name: ${{ matrix.os.icon }} GHDL ${{ matrix.version.install }} ${{ matrix.os.backend }} on ${{ matrix.os.name }}
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
matrix:
os:
- {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-20.04', runtime: '', backend: 'mcode'} # not supported
- {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-24.04', runtime: '', backend: 'xcode'} # not supported
- {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-24.04', runtime: '', backend: 'mcode'}
- {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-24.04', runtime: '', backend: 'llvm'}
- {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-24.04', runtime: '', backend: 'llvm-jit'}
- {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-24.04', runtime: '', backend: 'gcc'}
- {icon: '🍎', name: 'macOS', image: 'macos-13', runtime: '', backend: 'gcc'} # not supported
- {icon: '🍎', name: 'macOS', image: 'macos-13', runtime: '', backend: 'mcode'}
- {icon: '🍎', name: 'macOS', image: 'macos-13', runtime: '', backend: 'llvm'}
- {icon: '🍏', name: 'macOS', image: 'macos-14', runtime: '', backend: 'llvm'}
- {icon: '🪟', name: 'Windows', image: 'windows-2022', runtime: '', backend: 'mcode'}
- {icon: '🪟⬛', name: 'Windows', image: 'windows-2022', runtime: 'mingw32', backend: 'mcode'} # not supported
- {icon: '🪟🟦', name: 'Windows', image: 'windows-2022', runtime: 'mingw64', backend: 'mcode'}
- {icon: '🪟🟦', name: 'Windows', image: 'windows-2022', runtime: 'mingw64', backend: 'llvm'}
- {icon: '🪟🟦', name: 'Windows', image: 'windows-2022', runtime: 'mingw64', backend: 'llvm-jit'}
- {icon: '🪟🟨', name: 'Windows', image: 'windows-2022', runtime: 'ucrt64', backend: 'mcode'}
- {icon: '🪟🟨', name: 'Windows', image: 'windows-2022', runtime: 'ucrt64', backend: 'llvm'}
- {icon: '🪟🟨', name: 'Windows', image: 'windows-2022', runtime: 'ucrt64', backend: 'llvm-jit'}
version:
# - {install: '5.0.0', expected: '5.0.0'}
# - {install: 'latest', expected: '5.0.0'}
- {install: 'nightly', expected: '5.0.0-dev'}
include:
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-20.04', 'runtime': '', 'backend': 'mcode'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'runtime': '', 'backend': 'xcode'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'runtime': '', 'backend': 'mcode'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'runtime': '', 'backend': 'llvm'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'runtime': '', 'backend': 'llvm-jit'}
- {'icon': '🐧', 'name': 'Ubuntu', 'image': 'ubuntu-24.04', 'runtime': '', 'backend': 'gcc'}
- {'icon': '🍎', 'name': 'macOS', 'image': 'macos-13', 'runtime': '', 'backend': 'gcc'}
- {'icon': '🍎', 'name': 'macOS', 'image': 'macos-13', 'runtime': '', 'backend': 'mcode'}
- {'icon': '🍎', 'name': 'macOS', 'image': 'macos-13', 'runtime': '', 'backend': 'llvm'}
- {'icon': '🍏', 'name': 'macOS', 'image': 'macos-14', 'runtime': '', 'backend': 'llvm'}
- {'icon': '🪟', 'name': 'Windows', 'image': 'windows-2022', 'runtime': '', 'backend': 'mcode'}
- {'icon': '🪟⬛', 'name': 'Windows', 'image': 'windows-2022', 'runtime': 'mingw32', 'backend': 'mcode'}
- {'icon': '🪟🟦', 'name': 'Windows', 'image': 'windows-2022', 'runtime': 'mingw64', 'backend': 'mcode'}
- {'icon': '🪟🟦', 'name': 'Windows', 'image': 'windows-2022', 'runtime': 'mingw64', 'backend': 'llvm'}
- {'icon': '🪟🟦', 'name': 'Windows', 'image': 'windows-2022', 'runtime': 'mingw64', 'backend': 'llvm-jit'}
- {'icon': '🪟🟨', 'name': 'Windows', 'image': 'windows-2022', 'runtime': 'ucrt64', 'backend': 'mcode'}
- {'icon': '🪟🟨', 'name': 'Windows', 'image': 'windows-2022', 'runtime': 'ucrt64', 'backend': 'llvm'}
- {'icon': '🪟🟨', 'name': 'Windows', 'image': 'windows-2022', 'runtime': 'ucrt64', 'backend': 'llvm-jit'}
- {version: {install: '4.1.0', expected: '4.1.0'}, os: {icon: '🪟🟦', name: 'Windows', image: 'windows-2022', runtime: 'mingw64', backend: 'mcode'}}
- {version: {install: '4.1.0', expected: '4.1.0'}, os: {icon: '🪟🟦', name: 'Windows', image: 'windows-2022', runtime: 'mingw64', backend: 'llvm'}}
- {version: {install: '4.1.0', expected: '4.1.0'}, os: {icon: '🪟🟨', name: 'Windows', image: 'windows-2022', runtime: 'ucrt64', backend: 'mcode'}}
- {version: {install: '4.1.0', expected: '4.1.0'}, os: {icon: '🪟🟨', name: 'Windows', image: 'windows-2022', runtime: 'ucrt64', backend: 'llvm'}}

defaults:
run:
shell: bash

steps:
- name: 🟦 Setup MSYS2 for ${{ matrix.runtime }}
- name: Detect correct shell
id: detect
run: |
# Detect correct shell
if [[ "${{ matrix.os.name }}" == "Windows" && "${{ matrix.os.runtime }}" != "" ]]; then
printf "shell=msys2 {0}" >> $GITHUB_OUTPUT
else
printf "shell=bash" >> $GITHUB_OUTPUT
fi

- name: 🟦 Setup MSYS2 for ${{ matrix.os.runtime }}
uses: msys2/setup-msys2@v2
if: matrix.runtime != ''
if: matrix.os.runtime != ''
with:
msystem: ${{ matrix.runtime }}
msystem: ${{ matrix.os.runtime }}
update: true

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

- name: Verify on Linux or macOS
if: matrix.name == 'Ubuntu' || matrix.name == 'macOS'
- name: Verify on Linux, macOS and Windows (native)
if: matrix.os.name == 'Ubuntu' || matrix.os.name == 'macOS' || ( matrix.os.name == 'Windows' && matrix.os.runtime == '' )
run: |
printf "%s\n" "${PATH}"

which ghdl
ghdl --version
ANSI_LIGHT_RED=$'\x1b[91m'
ANSI_LIGHT_GREEN=$'\x1b[92m'
ANSI_NOCOLOR=$'\x1b[0m'

- name: Verify on Windows (native)
if: matrix.name == 'Windows' && matrix.runtime == ''
shell: powershell
run: |
echo $(Get-Command ghdl).Source
ghdl --version
printf "which ghdl: %s\n" "$(which ghdl)"

expected="${{ matrix.version.expected }}"
printf "%s" "Verify GHDL version '${expected}' ... "
if [[ "$(ghdl --version | head -n 1)" =~ ${expected//./\\.} ]]; then
printf "${ANSI_LIGHT_GREEN}%s${ANSI_NOCOLOR}\n" "[OK]"
else
printf "${ANSI_LIGHT_RED}%s\${ANSI_NOCOLOR}n" "[FAILED]"
printf "::warning title=%s::%s\n" "Test-SetupGHDL" "GHDL version doesn't match."

ghdl --version
fi

- name: Verify on Windows + MSYS2
if: matrix.name == 'Windows' && matrix.runtime != ''
shell: 'msys2 {0}'
if: matrix.os.name == 'Windows' && matrix.os.runtime != ''
shell: "msys2 {0}"
run: |
ANSI_LIGHT_RED=$'\x1b[91m'
ANSI_LIGHT_GREEN=$'\x1b[92m'
ANSI_NOCOLOR=$'\x1b[0m'

printf "which ghdl: %s\n" "$(which ghdl)"

expected="${{ matrix.version.expected }}"
printf "%s" "Verify GHDL version '${expected}' ... "
if [[ "$(ghdl --version | head -n 1)" =~ ${expected//./\\.} ]]; then
printf "${ANSI_LIGHT_GREEN}%s${ANSI_NOCOLOR}\n" "[OK]"
else
printf "${ANSI_LIGHT_RED}%s${ANSI_NOCOLOR}\n" "[FAILED]"
printf "::warning title=%s::%s\n" "Test-SetupGHDL" "GHDL version doesn't match."

ghdl --version
fi

- name: Verify on Windows (native) with Powershell
if: matrix.os.name == 'Windows' && matrix.os.runtime == ''
shell: powershell
run: |
which ghdl
echo $(Get-Command ghdl).Source
ghdl --version
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ This composite action, installs GHDL in a GitHub Action's workflow job.
## Features

* Select GHDL version:
* tagged release like `5.0.0`
* `latest` (stable) release, or
* tagged release like `5.0.0`, or
* `nightly` release (rolling release).
* Select GHDL backend:
* mcode
Expand Down Expand Up @@ -77,7 +76,7 @@ jobs:

| Parameter | Required | Default | Description |
|---------------------|:--------:|-------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `version` | no | `'nightly'` | A tagged GHDL version starting at `v5.0.0`, `latest` or `nightly`. |
| `version` | no | `'nightly'` | A tagged GHDL version starting at `v5.0.0` or `nightly`. |
| `backend` | no | `'mcode'` | GHDL backend: `llvm`, `llvm-jit`, `mcode`, `gcc`. |
| `runtime` | no | `''` | If runner OS is Windows, a MSYS2 runtime can be selected (`mingw64`, `ucrt64`). If not set, Windows native is used (not MSYS2 environment). |
| `install-directory` | no | `'install'` | Local installation directory, in case an archive asset is downloaded and extracted. |
Expand Down
8 changes: 5 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ runs:
# A generic test for supported named versions or tagged versions.
if [[ "${{ inputs.version }}" == "latest" ]]; then
# TODO: could be read from nightly's inventory.json
VERSION_IN_URL="5.0.0"
elif [[ "${{ inputs.version }}" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|nightly$ ]]; then
VERSION_IN_URL="v5.0.0"
elif [[ "${{ inputs.version }}" =~ ^v[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|nightly$ ]]; then
VERSION_IN_URL="${{ inputs.version }}"
elif [[ "${{ inputs.version }}" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}$ ]]; then
VERSION_IN_URL="v${{ inputs.version }}"
else
printf "::error title=%s::%s\n" "setup-ghdl" "Unsupported GHDL version '${{ inputs.version }}'."
exit 1
Expand Down Expand Up @@ -221,7 +223,7 @@ runs:
fi
fi

printf "%s" "Check if GHDL backend is supported for this runner OS version ... "
printf "%s" "Check if GHDL backend '${{ inputs.backend }}' is supported for this runner OS version ... "
if jq -e ".files.ghdl.\"${osName,,}\".\"${osMajorVersion}\".\"${osArchitecture}\".\"${osRuntime}\" | has(\"${{ inputs.backend }}\")" inventory.json > /dev/null; then
printf "${ANSI_LIGHT_GREEN}%s${ANSI_NOCOLOR}\n" "[OK]"
else
Expand Down
Loading