From 2138103604173844fcc344aaa09965f7a86e89b7 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 17 Jan 2025 11:20:13 +0100 Subject: [PATCH] Added 4.1.0 to the tests. --- .github/workflows/Pipeline.yml | 109 +++++++++++++++++++++++---------- action.yml | 14 ++++- 2 files changed, 86 insertions(+), 37 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 8fefc11..5d9267a 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -22,30 +22,44 @@ 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: - 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'} + os: + - {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-20.04', runtime: '', backend: 'mcode'} # not supported + - {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-22.04', runtime: '', backend: 'mcode'} + - {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-22.04', runtime: '', backend: 'llvm'} + - {icon: '🐧', name: 'Ubuntu', image: 'ubuntu-22.04', runtime: '', backend: 'gcc'} + - {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: '4.1.0', expected: '4.1.0'} +# - {install: '5.0.0', expected: '5.0.0'} +# - {install: 'latest', expected: '4.1.0'} + - {install: 'nightly', expected: '5.0.0-dev'} + exclude: + - {version: {install: '4.1.0'}, os: {image: 'ubuntu-24.04' }} # Ubuntu 24.04 didn't exist when 4.1.0 was released + - {version: {install: '4.1.0'}, os: {name: 'macOS' }} # macOS-13/14 didn't exist when 4.1.0 was released + - {version: {install: '4.1.0'}, os: {name: 'Windows', runtime: ""}} # There is no (functioning) standalone Windows version + - {version: {install: 'nightly'}, os: {image: 'ubuntu-22.04' }} # Nightly has no Ubuntu 22.04 support + defaults: run: shell: bash @@ -55,44 +69,71 @@ jobs: id: detect run: | # Detect correct shell - if [[ "${{ matrix.name }}" == "Windows" && "${{ matrix.runtime }}" != "" ]]; then + 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.runtime }} + - 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@dev 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, macOS and Windows (native) - if: matrix.name == 'Linux' || matrix.name == 'macOS' || ( matrix.name == 'Windows' && matrix.runtime == '' ) + if: matrix.os.name == 'Ubuntu' || matrix.os.name == 'macOS' || ( matrix.os.name == 'Windows' && matrix.os.runtime == '' ) run: | + + ANSI_LIGHT_RED=$'\x1b[91m' + ANSI_LIGHT_GREEN=$'\x1b[92m' + ANSI_NOCOLOR=$'\x1b[0m' + printf "which ghdl: %s\n" "$(which ghdl)" - ghdl --version + 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 != '' + 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)" - ghdl --version + 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.name == 'Windows' && matrix.runtime == '' + if: matrix.os.name == 'Windows' && matrix.os.runtime == '' shell: powershell run: | echo $(Get-Command ghdl).Source diff --git a/action.yml b/action.yml index a5fa22a..2a5fb58 100644 --- a/action.yml +++ b/action.yml @@ -122,7 +122,13 @@ runs: printf "::error title=%s::%s\n" "setup-ghdl" "Unsupported architecture '${{ runner.arch }}' for Windows." exit 1 fi - if [[ "${{ inputs.runtime }}" == "mingw64" ]]; then + if [[ "${{ inputs.runtime }}" == "mingw32" ]]; then + osRuntime="mingw32" + + printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Installing 'jq' file ..." + pacman -S --noconfirm mingw32/mingw-w64-i686-jq + printf "::endgroup::\n" + elif [[ "${{ inputs.runtime }}" == "mingw64" ]]; then osRuntime="mingw64" printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Installing 'jq' file ..." @@ -152,9 +158,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