diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7b0afb1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +# end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +indent_size = 2 +tab_width = 2 + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e91b107 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + # Maintain GitHub Action runners + - package-ecosystem: "github-actions" + directory: "/" + target-branch: dev + commit-message: + prefix: "[Dependabot]" + labels: + - Dependencies + assignees: + - Paebbels + reviewers: + - Paebbels + schedule: + interval: "daily" # Checks on Monday trough Friday. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..4ed2d90 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,30 @@ +# New Features + +* tbd +* tbd + +# Changes + +* tbd +* tbd + +# Bug Fixes + +* tbd +* tbd + +# Documentation + +* tbd +* tbd + +# Unit Tests + +* tbd +* tbd + +---------- +# Related Issues and Pull-Requests + +* tbd +* tbd diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml new file mode 100644 index 0000000..f2ecff7 --- /dev/null +++ b/.github/workflows/Pipeline.yml @@ -0,0 +1,46 @@ +name: Verification of setup-ghdl + +on: + push: + workflow_dispatch: + +jobs: + Setup-GHDL-Nightly: + 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', '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 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 + run: | + ghdl --version diff --git a/README.md b/README.md index 87f27de..7577cbb 100644 --- a/README.md +++ b/README.md @@ -1 +1,69 @@ -# `setup-ghdl` GitHub Action +# Setup GHDL in GitHub Action Workflows + +This composite action, installs GHDL in a GitHub Action's workflow job. + + +## 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 + +## Usage + +```yaml +jobs: + MyJob: + steps: + - name: Run VHDL Simulation + uses: paebbels/setup-ghdl@v1 + with: + version: nightly + backend: mcode + investigate: true +``` + + +### Input Parameters + +| Parameter | Required | Default | Description | +|----------------------------|:--------:|-------------|----------------------------------------------------------| +| `version` | no | `'nightly'` | A tagged GHDL version starting at `v5.0.0` or `nightly`. | +| `backend` | no | `'mcode'` | GHDL backend: `llvm`, `llvm-jit`, `mcode`, `gcc`. | +| `investigate` | no | `false` | If enabled, details and check GHDL installation. | + + +### Output Parameters + +| Parameter | Description | +|--------------------|-------------| +| `ghdl-binary-dir` | tbd | +| `ghdl-library-dir` | tbd | + + +## Dependencies + +### On Linux (Ubuntu) + +* Further dependencies will be installed using `apt-get`. +* GHDL will be added to `PATH`. + +### On macOS + +*tbd* + +### On Windows (native) + + +### On Windows + MSYS2 + +## Contributors + +* [Patrick Lehmann](https://GitHub.com/Paebbels) (Maintainer) +* [and more...](https://GitHub.com/ghdl/setup-ghdl/graphs/contributors) + +### 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. diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..8c71f4d --- /dev/null +++ b/action.yml @@ -0,0 +1,228 @@ +name: Setup GHDL +branding: + icon: play + color: gray-dark +description: Install and setup GHDL downloaded from GHDL's release pages at GitHub. +author: Patrick Lehmann (@Paebbels) + +inputs: + version: + type: string + required: false + default: 'nightly' + backend: + type: string + required: false + default: 'mcode' + runtime: + type: string + required: false + default: '' + install-directory: + type: string + required: false + default: 'install' + investigate: + type: boolean + required: false + default: false + +runs: + using: composite + steps: + - name: Variables + id: variables + shell: bash + run: | + tee "${GITHUB_OUTPUT}" <> $GITHUB_ENV" + echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl)" >> $GITHUB_ENV