Skip to content
play

GitHub Action

Setup GHDL

nightly Latest version

Setup GHDL

play

Setup GHDL

Easily install nightly GHDL assets in GitHub Actions workflows

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup GHDL

uses: ghdl/setup-ghdl-ci@nightly

Learn more about this action in ghdl/setup-ghdl-ci

Choose a version

'test' workflow Status

GitHub Action to setup GHDL

setup-ghdl-ci is a JavaScript GitHub Action (GHA) to setup GHDL using nightly release assets. Latest packages are retrieved and installed along with required dependencies, to enable testing of VHDL designs in Continuous Integration (CI) workflows.

Currently, GitHub Actions workflow tasks running on Ubuntu or Windows are supported only. Precisely environments ubuntu-20.04, ubuntu-22.04|ubuntu-latest, windows-2019 or windows-2022|windows-latest can be used.

Contributions for supporting addional platforms or CI services are welcome! For instance, GHDL is already tested on GitHub Actions macos-latest, but packaging is not done yet.

Usage

See test.yml and the actions tab for runs of this action! 🚀

This Action sets envvars GHDL, GHDL_PREFIX, and (on Windows only) MSYS2_PATH. Those can be used for running GHDL from shells other than bash.

Ubuntu

- uses: ghdl/setup-ghdl-ci@nightly
  with:
    backend: llvm

- run: |
    ghdl --version

    $GHDL --version

Allowed values for backend are: mcode (default), llvm or gcc.

Windows

- uses: msys2/setup-msys2@v2
  with:
    msystem: MINGW64
    update: true

- uses: ghdl/setup-ghdl-ci@nightly
  with:
    backend: llvm

- shell: msys2 {0}
  run: |
    ghdl --version

    $GHDL --version

- shell: bash
  run: |
    $GHDL --version

    "$MSYS2_PATH"MINGW64\\bin\\ghdl.exe --version

- shell: powershell
  run: |
    & "$env:GHDL" --version

    & "$($env:MSYS2_PATH)MINGW64\bin\ghdl.exe" --version

Note that MSYS2 must be setup first. Using Action msys2/setup-msys2 is recommended. Allowed values are MINGW64, MINGW32, or UCRT64. Note that simulation with mcode backend on 64 bits is not supported yet, and backend LLVM is not available on 32 bits yet.

Development

Changes should be done in main.js, but are uneffective until JS sources are packaged. Packaging generates index.js, which is the entry point for GitHub Actions (as defined in action.yml). Packaging assembles the code into one file, enabling fast and reliable execution and preventing the need to check in node_modules.

$ npm install
$ npm run pkg