diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 2f58b3f..fc9aafa 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -1,3 +1,19 @@ +# The MIT License (MIT) +# +# Copyright © 2024 The GHDL Developers +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. name: Verification of setup-ghdl on: @@ -6,12 +22,12 @@ on: jobs: Setup-GHDL-Nightly: - name: ${{ matrix.os.icon }} Setup GHDL ${{ matrix.os.backend }} on ${{ matrix.os.name }} - runs-on: ${{ matrix.os.image }} + name: ${{ matrix.icon }} Setup GHDL ${{ matrix.backend }} on ${{ matrix.name }} + runs-on: ${{ matrix.image }} strategy: fail-fast: false matrix: - os: + include: - {'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'} @@ -31,28 +47,37 @@ jobs: shell: bash steps: - - name: 🟦 Setup MSYS2 for ${{ matrix.os.runtime }} + - name: 🟦 Setup MSYS2 for ${{ matrix.runtime }} uses: msys2/setup-msys2@v2 - if: matrix.os.runtime != '' + if: matrix.runtime != '' with: - msystem: ${{ matrix.os.runtime }} + msystem: ${{ matrix.runtime }} update: true - - name: Setup GHDL ${{ matrix.os.backend }} + - name: Setup GHDL ${{ matrix.backend }} uses: paebbels/setup-ghdl@main with: version: nightly - backend: ${{ matrix.os.backend }} - runtime: ${{ matrix.os.runtime }} + backend: ${{ matrix.backend }} + runtime: ${{ matrix.runtime }} investigate: true - - name: Verify on Linux and macOS - if: matrix.os.name == 'Ubuntu' || matrix.os.name == 'macOS' + - name: Verify on Linux or macOS + if: matrix.name == 'Ubuntu' || matrix.name == 'macOS' run: | + which ghdl + ghdl --version + + - name: Verify on Windows (native) + if: matrix.name == 'Windows' && matrix.runtime == '' + shell: powershell + run: | + echo $(Get-Command ghdl).Source ghdl --version - name: Verify on Windows + MSYS2 - if: matrix.os.name == 'Windows' && matrix.os.runtime != '' + if: matrix.name == 'Windows' && matrix.runtime != '' shell: 'msys2 {0}' run: | + which ghdl ghdl --version diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..f1aab53 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,16 @@ +# The MIT License (MIT) + +Copyright © 2024 The GHDL Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 3f5a443..b270792 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,15 @@ This composite action, installs GHDL in a GitHub Action's workflow job. +> [!IMPORTANT] +> This GitHub Action replaces [`setup-ghdl-ci`](https://github.com/ghdl/setup-ghdl-ci). ## Features -* Select GHDL version (tagged release or nightly build). -* Select GHDL backend (LLVM, LLVM-JIT, mcode, GCC) -* Activate an investigation mode (check and show GHDL installation, ...) -* Supported runner OS' (automatically detected): Ubuntu 2024.04, macOS (x86-64), macOS (aarch64), Windows +* Select GHDL version (tagged release like `5.0.0`, `latest` (stable) release or `nightly` release (rolling release)). +* Select GHDL backend (LLVM, LLVM-JIT, mcode, GCC). +* Activate an investigation mode (check and show GHDL installation, ...). +* Supported runner OS' (automatically detected): Ubuntu 2024.04, macOS (x86-64), macOS (aarch64), Windows. ## Usage @@ -64,7 +66,7 @@ jobs: | Parameter | Required | Default | Description | |---------------------|:--------:|-------------|---------------------------------------------------------------------------------------------------------------------------------------------| -| `version` | no | `'nightly'` | A tagged GHDL version starting at `v5.0.0` or `nightly`. | +| `version` | no | `'nightly'` | A tagged GHDL version starting at `v5.0.0`, `latest` 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. | @@ -79,28 +81,36 @@ jobs: | `ghdl-lib-directory` | tbd | -## Dependencies +## Behavior and Dependencies ### On Linux (Ubuntu) -* Download GHDL asset as `*.tar.gz` and extract files to `install-directory`. -* Further dependencies will be installed using `apt-get`. -* GHDL will be added to `PATH`. +* Download GHDL asset from https://github.com/ghdl/ghdl/releases as `*.tar.gz` and extract files into + `install-directory`. +* Further dependencies will be installed using `apt-get` and reading the embedded `ubuntu.requirements` + file. +* GHDL's `bin` directory will be added to `PATH`. ### On macOS -* Download GHDL asset as `*.tar.gz` and extract files to `install-directory`. -* GHDL will be added to `PATH`. +* Download GHDL asset from https://github.com/ghdl/ghdl/releases as `*.tar.gz` and extract files into + `install-directory`. +* All dependencies are contained within the archive, thus no further dependencies need to be installed. +* GHDL's `bin` directory will be added to `PATH`. ### On Windows (native) -*tbd* +* Download GHDL asset from https://github.com/ghdl/ghdl/releases as `*.zip` into `install-directory`. +* The archive is extracted into the same directory. +* All dependencies are contained within the archive, thus no further dependencies need to be installed. +* GHDL's `bin` directory will be added to `PATH`. ### On Windows + MSYS2 -* Download GHDL asset as `*.pkg.tar.zst` installation package for pacman. -* Install package and further dependencies (listed in the package) via pacman. - +* Download GHDL asset from https://github.com/ghdl/ghdl/releases as `*.pkg.tar.zst` installation package for pacman. +* Install this package. +* Further dependencies get automatically installed by pacman, as listed as dependencies in the package. +* No need to modify `PATH`, because GHDL got installed into the MSYS2 system. ## Contributors @@ -109,5 +119,15 @@ jobs: ### Credits -This GitHub Action replaces `setup-ghdl-ci`, a Javascript Action developed by Umarcor, with a composite action using -simples instructions (`curl`, `tar`, `apt-get`) written in Bash. +This GitHub Action replaces `setup-ghdl-ci`, a Javascript Action developed by +[Unai Martinez-Corral](https://GitHub.com/umarcor), with a composite action using simples instructions (`curl`, `tar`, +`apt-get`) written in Bash or Powershell. + + +## License + +This GitHub Composite Action (source code) licensed under [The MIT License](LICENSE.md). + +--- + +SPDX-License-Identifier: MIT diff --git a/action.yml b/action.yml index 5da8bec..f759de1 100644 --- a/action.yml +++ b/action.yml @@ -1,3 +1,19 @@ +# The MIT License (MIT) +# +# Copyright © 2024 The GHDL Developers +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. name: Setup GHDL branding: icon: play @@ -45,17 +61,12 @@ runs: shell: bash run: | tee "${GITHUB_OUTPUT}" <> $GITHUB_ENV" - echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl)" >> $GITHUB_ENV + printf "Setting environment variable 'GHDL_PREFIX' ...\n" + tee "${GITHUB_ENV}" <