aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorUnai Martinez-Corral <38422348+umarcor@users.noreply.github.com>2023-03-03 12:18:07 +0000
committerGitHub <noreply@github.com>2023-03-03 13:18:07 +0100
commita0f99db3b3557bb996b5511f3fad6832995eb69f (patch)
treef3e7ab0232be950285e24d1c523215affcb376f7 /.github
parent0c080e2d4a141d0c8fb447891f6520fb2712e4ae (diff)
downloadghdl-a0f99db3b3557bb996b5511f3fad6832995eb69f.tar.gz
ghdl-a0f99db3b3557bb996b5511f3fad6832995eb69f.tar.bz2
ghdl-a0f99db3b3557bb996b5511f3fad6832995eb69f.zip
ci: reusable workflows (#2367)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/Coverage.yml93
-rw-r--r--.github/workflows/Test.yml521
-rw-r--r--.github/workflows/Windows-MSYS2.yml132
-rw-r--r--.github/workflows/Windows-Standalone.yml166
-rw-r--r--.github/workflows/Windows-pyGHDL.yml122
5 files changed, 526 insertions, 508 deletions
diff --git a/.github/workflows/Coverage.yml b/.github/workflows/Coverage.yml
new file mode 100644
index 000000000..785e879b3
--- /dev/null
+++ b/.github/workflows/Coverage.yml
@@ -0,0 +1,93 @@
+name: Coverage
+
+on:
+ workflow_call:
+
+jobs:
+
+
+#
+# pyGHDL Coverage (MINGW64)
+#
+ coverage:
+ name: '📈 Coverage'
+ runs-on: windows-latest
+
+ defaults:
+ run:
+ shell: msys2 {0}
+
+ steps:
+
+ - name: '🟪 Setup MSYS2'
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: MINGW64
+ update: true
+ pacboy: >
+ python-pip:p
+ python-setuptools:p
+
+ - name: '⚙ git config'
+ run: git config --global core.autocrlf input
+ shell: bash
+
+ - name: '🧰 Checkout'
+ uses: actions/checkout@v3
+
+ - name: '📥 Download artifact: package'
+ uses: actions/download-artifact@v3
+ with:
+ path: artifact
+ name: MINGW64-llvm
+
+ - name: '🛠 Install package and 🐍 Python dependencies'
+ run: |
+ pacman --noconfirm -U artifact/mingw-w64-*-ghdl-llvm-*.zst
+ pip3 install --disable-pip-version-check -r testsuite/requirements.txt
+
+ - name: '🚦 Run tests to generate coverage report'
+ run: PYTHONPATH=$(pwd) python3 -m pytest -rA --cov=.. --cov-config=.coveragerc testsuite/pyunit
+
+ - name: Generate XML coverage report
+ if: always()
+ run: coverage xml
+
+ - name: '📤 Upload artifact: coverage report'
+ if: always()
+ uses: actions/upload-artifact@v3
+ with:
+ name: coverage
+ path: coverage.xml
+
+#
+# Coverage Publish (Ubuntu)
+#
+ coverage-publish:
+ name: '📮 Publish coverage report'
+ runs-on: ubuntu-latest
+
+ needs:
+ - coverage
+
+ if: always() && github.repository == 'ghdl/ghdl' && github.event_name != 'pull_request'
+
+ steps:
+
+ - name: '📥 Download artifact: coverage report'
+ uses: actions/download-artifact@v3
+ with:
+ path: .
+ name: coverage
+
+ - name: CodeCov
+ uses: codecov/codecov-action@v3
+ with:
+ file: coverage.xml
+ flags: unittests
+
+ - name: Codacy
+ uses: codacy/codacy-coverage-reporter-action@v1
+ with:
+ project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
+ coverage-reports: coverage.xml \ No newline at end of file
diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml
index 5bf8e7fae..1af936e24 100644
--- a/.github/workflows/Test.yml
+++ b/.github/workflows/Test.yml
@@ -230,421 +230,21 @@ jobs:
path: ghdl-macos-${{ matrix.os }}-${{ matrix.backend }}.tgz
if-no-files-found: error
-#
-# Pure Windows Build (on MSYS2) - create zip (and also pre-wheel zip)
-#
- win:
- name: '🚧${{ matrix.icon }} ${{ matrix.sys }} (pure-build)'
- runs-on: windows-latest
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32', arch: 'i686' }
-# - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64', arch: 'x86_64' } #! simulation with mcode is not yet supported on win64
- - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64', arch: 'ucrt-x86_64' } #! experimental; simulation with mcode is not yet supported on win64
-
- env:
- MINGW_ARCH: ${{ matrix.sys }}
- defaults:
- run:
- shell: msys2 {0}
-
- steps:
- - name: '${{ matrix.icon }} Setup MSYS2'
- uses: msys2/setup-msys2@v2
- with:
- msystem: ${{ matrix.sys }}
- update: true
- install: base-devel git mingw-w64-${{matrix.arch}}-gcc-ada mingw-w64-${{matrix.arch}}-zlib zip
- pacboy: >
- toolchain:p
- python-pip:p
-
- - name: '⚙ git config'
- run: git config --global core.autocrlf input
- shell: bash
-
- - name: '🧰 Checkout'
- uses: actions/checkout@v3
- with:
- # The command 'git describe' (used for version) needs the history.
- fetch-depth: 0
-
- - name: '🚧 Build package'
- run: |
- pip3 install pefile
- mkdir builddir
- cd builddir
- ../configure --prefix='/GHDL' LDFLAGS="-static -Wl,--stack=8388608" --enable-libghdl
- make
- mkdir -p 'GHDL'
- make install DESTDIR=.
- # No need to add dll dependencies for ghdl, as it is compiled
- # with -static
- make python-wheel
- zip pre-wheel-${{matrix.sys}}.zip -r dist-wheel setup-standalone.py
- zip ghdl-${{matrix.sys}}.zip -r GHDL
-
- - name: '📤 Upload artifact: pre-wheel'
- uses: actions/upload-artifact@v3
- with:
- name: ${{ matrix.sys }}-pre-wheel
- path: |
- builddir/pre-wheel-${{matrix.sys}}.zip
-
- - name: '📤 Upload artifact: zip pure-win'
- uses: actions/upload-artifact@v3
- with:
- name: ${{ matrix.sys }}-zip-win
- path: |
- builddir/ghdl-${{matrix.sys}}.zip
-
-#
-# Create pure-Windows CPython pyGHDL platform wheel (from the pre-wheel zip)
-#
- win-wheel:
- name: '🚦🐍${{ matrix.icon }} ${{ matrix.sys }} (pyGHDL-wheel)'
- runs-on: windows-latest
-
- needs:
- - win
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - {icon: '🟪', sys: 'MINGW32', pyarch: x86 }
-# - {icon: '🟦', sys: 'MINGW64', pyarch: x64 }
- - {icon: '🟨', sys: 'UCRT64', pyarch: x64 }
-
- defaults:
- run:
- shell: pwsh
-
- steps:
- - name: '🐍 Setup Python'
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
- architecture: ${{ matrix.pyarch }}
-
- - name: '📥 Download artifact: package'
- uses: actions/download-artifact@v3
- with:
- path: artifact
- name: ${{ matrix.sys }}-pre-wheel
-
- - name: '🐍 Build python wheel'
- run: |
- pip3 install wheel
- pip3 install pyTooling
- unzip artifact/pre-wheel-${{ matrix.sys }}.zip
- python3 ./setup-standalone.py bdist_wheel
- dir dist
-
- - name: '🐍 Sanity check of the python wheel'
- run: |
- pip3 install -v (get-item dist\pyGHDL-*.whl)
- dir -r ${env:Python3_ROOT_DIR}\Lib\site-packages\pyGHDL
- python3 -m pyGHDL.cli.lsp --version
- python3 -m pyGHDL.cli.dom version
-
- - name: '📤 Upload artifact: wheel'
- uses: actions/upload-artifact@v3
- with:
- name: ${{ matrix.sys }}-wheel
- path: |
- dist/pyGHDL-*.whl
-
- - name: '${{ matrix.icon }} Setup MSYS2'
- uses: msys2/setup-msys2@v2
- with:
- msystem: ${{ matrix.sys }}
- update: true
-
-#
-# Windows Test of standalone zip
-#
- win-test:
- name: '🚦🐍🥡${{ matrix.icon }} ${{ matrix.sys }} (test sa)'
- runs-on: windows-latest
-
- needs:
- - win
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - {icon: '🟪', sys: 'MINGW32' }
-# - {icon: '🟦', sys: 'MINGW64' } #! simulation with mcode is not yet supported on win64
-# - {icon: '🟨', sys: 'UCRT64' } #! experimental; simulation with mcode is not yet supported on win64
- defaults:
- run:
- shell: pwsh
+ Windows-MSYS2:
+ uses: ./.github/workflows/Windows-MSYS2.yml
- steps:
- - name: '📥 Download artifact: package'
- uses: actions/download-artifact@v3
- with:
- path: artifact
- name: ${{ matrix.sys }}-zip-win
+ Windows-Standalone:
+ uses: ./.github/workflows/Windows-Standalone.yml
- - name: '⚙ Extract package'
- run: |
- dir
- unzip artifact\ghdl-${{matrix.sys}}.zip
- dir
-
- - name: '🛠 Set envvars'
- run: |
- $GHDL_DIR = (pwd).Path + '\GHDL\bin'
- echo "GHDL=${GHDL_DIR}\ghdl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- echo "$GHDL_DIR" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- dir $GHDL_DIR
+ Windows-pyGHDL:
+ needs: Windows-Standalone
+ uses: ./.github/workflows/Windows-pyGHDL.yml
- - name: '🛠 Sanity check'
- run: |
- echo "GHDL is ${env:GHDL}"
- dir ${env:GHDL}
- & ${env:GHDL} version
- echo "sha: ${{github.sha}}"
- echo "head_ref: ${{github.head_ref}}"
- echo "ref_name: ${{github.ref_name}}"
-
- - name: '⚙ git config'
- run: |
- dir
- dir ${env:GHDL}
- git config --global core.autocrlf input
-
- - name: '🧰 Checkout'
- uses: actions/checkout@v3
- with:
- path: checkout
-
- - name: '${{ matrix.icon }} Setup MSYS2'
- uses: msys2/setup-msys2@v2
- with:
- msystem: ${{ matrix.sys }}
- update: true
- pacboy: >
- diffutils:p
- gcc:p
-
- - name: '🚦 Testsuite for ghdl'
- shell: msys2 {0}
- run: |
- set -x
- pwd
- ls -l
- echo "PATH: $PATH"
- echo "GHDL: $GHDL"
- cygghdl="$(cygpath -u $GHDL)"
- echo "cyg GHDL: $cygghdl"
- $cygghdl -v
- GHDL="$cygghdl"
- PATH="$PATH:$(dirname $cygghdl)"
- echo "PATH: $PATH"
- ghdl version
- cd checkout
- ./testsuite/testsuite.sh gna
-
-#
-# Windows Test of pyGHDL platform wheel
-#
- win-test-wheel:
- name: '🚦🐍🥡${{ matrix.icon }} ${{ matrix.sys }} (test sa py)'
- runs-on: windows-latest
-
- needs:
- - win-wheel
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - {icon: '🟪', sys: 'MINGW32', pyarch: x86 }
-# - {icon: '🟦', sys: 'MINGW64', pyarch: x64 }
- - {icon: '🟨', sys: 'UCRT64', pyarch: x64 }
-
- defaults:
- run:
- shell: pwsh
-
- steps:
- - name: '🐍 Setup Python'
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
- architecture: ${{ matrix.pyarch }}
-
- - name: '📥 Download artifact: package'
- uses: actions/download-artifact@v3
- with:
- path: artifact
- name: ${{ matrix.sys }}-wheel
-
- - name: '🐍 Sanity check of the python wheel'
- run: |
- pip3 install -v (get-item artifact\pyGHDL-*.whl)
-
- - name: '⚙ git config'
- run: |
- dir
- dir ${env:GHDL}
- git config --global core.autocrlf input
-
- - name: '🧰 Checkout'
- uses: actions/checkout@v3
- with:
- path: checkout
-
- - name: '🚦 pyunit tests'
- run: |
- pip3 install pytest
- dir checkout
- cd checkout/testsuite
- python3 -m pytest pyunit
-
-#
-# Windows MSYS2 Build
-#
- msys2:
- name: '🚧${{ matrix.icon }} ${{ matrix.sys }} ${{ matrix.pkg }} (build)'
- runs-on: windows-latest
-
- strategy:
- fail-fast: false
- matrix:
- include:
-# - {icon: '🟪', pkg: 'llvm', sys: 'MINGW32' } ! not yet functional
- - {icon: '🟦', pkg: 'llvm', sys: 'MINGW64' }
- - {icon: '🟨', pkg: 'llvm', sys: 'UCRT64' } #! experimental
- - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32' }
-# - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64' } #! simulation with mcode is not yet supported on win64
- - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64' } #! experimental; simulation with mcode is not yet supported on win64
-
- env:
- MINGW_ARCH: ${{ matrix.sys }}
- defaults:
- run:
- shell: msys2 {0}
-
- steps:
- - name: '${{ matrix.icon }} Setup MSYS2'
- uses: msys2/setup-msys2@v2
- with:
- msystem: ${{ matrix.sys }}
- update: true
- install: base-devel git
- pacboy: toolchain:p
-
- - name: '⚙ git config'
- run: git config --global core.autocrlf input
- shell: bash
-
- - name: '🧰 Checkout'
- uses: actions/checkout@v3
- with:
- # The command 'git describe' (used for version) needs the history.
- fetch-depth: 0
-
- - name: '🚧 Build package'
- run: |
- cd scripts/msys2-${{ matrix.pkg }}
- makepkg-mingw --noconfirm --noprogressbar -sCLf
- for item in src pkg; do
- tar czf msys2-${{ matrix.pkg }}."$item".tar.gz "$item"
- done
-
- - name: '📤 Upload artifact: builddir'
- uses: actions/upload-artifact@v3
- with:
- name: ${{ matrix.sys }}-${{ matrix.pkg }}-builddir
- path: |
- scripts/msys2-${{ matrix.pkg }}/msys2-${{ matrix.pkg }}.src.tar.gz
- scripts/msys2-${{ matrix.pkg }}/msys2-${{ matrix.pkg }}.pkg.tar.gz
-
- - name: '📤 Upload artifact: package'
- uses: actions/upload-artifact@v3
- with:
- name: ${{ matrix.sys }}-${{ matrix.pkg }}
- path: scripts/msys2-${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst
- if-no-files-found: error
-
-#
-# Windows MSYS2 Test
-#
- msys2-test:
- name: '🚦${{ matrix.sys.icon }} ${{ matrix.sys.sys }} ${{ matrix.sys.pkg }} ${{ matrix.suite }}'
- runs-on: windows-latest
-
- needs:
- - msys2
-
- strategy:
- fail-fast: false
- matrix:
- sys:
-# - {icon: '🟪', pkg: 'llvm', sys: 'MINGW32' } ! not yet functional
- - {icon: '🟦', pkg: 'llvm', sys: 'MINGW64' }
- - {icon: '🟨', pkg: 'llvm', sys: 'UCRT64' } #! experimental
- - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32' }
-# - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64' } ! simulation with mcode is not yet supported on win64
-# - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64' } ! experimental; simulation with mcode is not yet supported on win64
-
- suite:
- - 'sanity pyunit vpi vhpi'
- - 'gna'
- - 'vests'
- - 'synth'
-
- defaults:
- run:
- shell: msys2 {0}
-
- steps:
- - name: '${{ matrix.sys.icon }} Setup MSYS2'
- uses: msys2/setup-msys2@v2
- with:
- msystem: ${{ matrix.sys.sys }}
- update: true
- pacboy: >
- diffutils:p
- gcc:p
- python-pip:p
- python-setuptools:p
-
- - name: '⚙ git config'
- run: git config --global core.autocrlf input
- shell: bash
-
- - name: '🧰 Checkout'
- uses: actions/checkout@v3
-
- - name: '📥 Download artifact: package'
- uses: actions/download-artifact@v3
- with:
- path: artifact
- name: ${{ matrix.sys.sys }}-${{ matrix.sys.pkg }}
-
- - name: '🛠 Install package and 🐍 Python dependencies'
- run: |
- pacman --noconfirm -U artifact/mingw-w64-*-ghdl-${{ matrix.sys.pkg }}-*.zst
- pip3 install -r testsuite/requirements.txt
-
- - name: '🚦 Test package'
- run: GHDL=ghdl ./testsuite/testsuite.sh ${{ matrix.suite }}
-
#
# Release
#
-
Release:
name: '📦 Release'
runs-on: ubuntu-latest
@@ -653,10 +253,9 @@ jobs:
- doc
- lin
- osx
- - win
- - win-wheel
- - win-test
- - msys2-test
+ - Windows-MSYS2
+ - Windows-Standalone
+ - Windows-pyGHDL
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))
@@ -690,101 +289,7 @@ jobs:
tag: 'nightly'
files: ${{ steps.files.outputs.list }}
-#
-# pyGHDL Coverage (MINGW64)
-#
-
- coverage:
- name: '📈 Coverage'
- runs-on: windows-latest
-
- needs:
- - msys2
-
- defaults:
- run:
- shell: msys2 {0}
-
- steps:
-
- - name: '🟪 Setup MSYS2'
- uses: msys2/setup-msys2@v2
- with:
- msystem: MINGW64
- update: true
- pacboy: >
- python-pip:p
- python-setuptools:p
-
- - name: '⚙ git config'
- run: git config --global core.autocrlf input
- shell: bash
-
- - name: '🧰 Checkout'
- uses: actions/checkout@v3
-
- - name: '📥 Download artifact: package'
- uses: actions/download-artifact@v3
- with:
- path: artifact
- name: MINGW64-llvm
-
- - name: '🛠 Install package and 🐍 Python dependencies'
- run: |
- pacman --noconfirm -U artifact/mingw-w64-*-ghdl-llvm-*.zst
- pip3 install --disable-pip-version-check -r testsuite/requirements.txt
-
- - name: '🚦 Run tests to generate coverage report'
- run: PYTHONPATH=$(pwd) python3 -m pytest -rA --cov=.. --cov-config=.coveragerc testsuite/pyunit
-
- - name: Generate XML coverage report
- if: always()
- run: coverage xml
-
- - name: '📤 Upload artifact: coverage report'
- if: always()
- uses: actions/upload-artifact@v3
- with:
- name: coverage
- path: coverage.xml
-
-#
-# Coverage Publish (Ubuntu)
-#
-
- coverage-publish:
- name: '📮 Publish coverage report'
- runs-on: ubuntu-latest
-
- needs:
- - coverage
- if: always() && github.repository == 'ghdl/ghdl' && github.event_name != 'pull_request'
-
- steps:
-
- - name: '📥 Download artifact: coverage report'
- uses: actions/download-artifact@v3
- with:
- path: .
- name: coverage
-
- - name: CodeCov
- uses: codecov/codecov-action@v3
- with:
- file: coverage.xml
- flags: unittests
-
- - name: Codacy
- uses: codacy/codacy-coverage-reporter-action@v1
- with:
- project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
- coverage-reports: coverage.xml
-
-#---
-
-# TODO:
-# - Re-package a MINGW/MSYS2 package to provide a 'standalone' tarball/zipfile.
-# - https://github.com/ghdl/ghdl/issues/318#issuecomment-286246287
-#
-# - Add GNAT GPL 32-bit build job with mcode backend
+ Coverage:
+ needs: Windows-MSYS2
+ uses: ./.github/workflows/Coverage.yml
diff --git a/.github/workflows/Windows-MSYS2.yml b/.github/workflows/Windows-MSYS2.yml
new file mode 100644
index 000000000..48eb8dce1
--- /dev/null
+++ b/.github/workflows/Windows-MSYS2.yml
@@ -0,0 +1,132 @@
+name: Windows MSYS2
+
+on:
+ workflow_call:
+
+jobs:
+
+
+ Build:
+ name: '🚧${{ matrix.icon }} ${{ matrix.sys }} ${{ matrix.pkg }} (build)'
+ runs-on: windows-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+# - {icon: '🟪', pkg: 'llvm', sys: 'MINGW32' } ! not yet functional
+ - {icon: '🟦', pkg: 'llvm', sys: 'MINGW64' }
+ - {icon: '🟨', pkg: 'llvm', sys: 'UCRT64' } #! experimental
+ - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32' }
+# - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64' } #! simulation with mcode is not yet supported on win64
+ - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64' } #! experimental; simulation with mcode is not yet supported on win64
+
+ env:
+ MINGW_ARCH: ${{ matrix.sys }}
+ defaults:
+ run:
+ shell: msys2 {0}
+
+ steps:
+ - name: '${{ matrix.icon }} Setup MSYS2'
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.sys }}
+ update: true
+ install: base-devel git
+ pacboy: toolchain:p
+
+ - name: '⚙ git config'
+ run: git config --global core.autocrlf input
+ shell: bash
+
+ - name: '🧰 Checkout'
+ uses: actions/checkout@v3
+ with:
+ # The command 'git describe' (used for version) needs the history.
+ fetch-depth: 0
+
+ - name: '🚧 Build package'
+ run: |
+ cd scripts/msys2-${{ matrix.pkg }}
+ makepkg-mingw --noconfirm --noprogressbar -sCLf
+ for item in src pkg; do
+ tar czf msys2-${{ matrix.pkg }}."$item".tar.gz "$item"
+ done
+
+ - name: '📤 Upload artifact: builddir'
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ matrix.sys }}-${{ matrix.pkg }}-builddir
+ path: |
+ scripts/msys2-${{ matrix.pkg }}/msys2-${{ matrix.pkg }}.src.tar.gz
+ scripts/msys2-${{ matrix.pkg }}/msys2-${{ matrix.pkg }}.pkg.tar.gz
+
+ - name: '📤 Upload artifact: package'
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ matrix.sys }}-${{ matrix.pkg }}
+ path: scripts/msys2-${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst
+ if-no-files-found: error
+
+
+ Test:
+ name: '🚦${{ matrix.sys.icon }} ${{ matrix.sys.sys }} ${{ matrix.sys.pkg }} ${{ matrix.suite }}'
+ runs-on: windows-latest
+
+ needs:
+ - Build
+
+ strategy:
+ fail-fast: false
+ matrix:
+ sys:
+# - {icon: '🟪', pkg: 'llvm', sys: 'MINGW32' } ! not yet functional
+ - {icon: '🟦', pkg: 'llvm', sys: 'MINGW64' }
+ - {icon: '🟨', pkg: 'llvm', sys: 'UCRT64' } #! experimental
+ - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32' }
+# - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64' } ! simulation with mcode is not yet supported on win64
+# - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64' } ! experimental; simulation with mcode is not yet supported on win64
+
+ suite:
+ - 'sanity pyunit vpi vhpi'
+ - 'gna'
+ - 'vests'
+ - 'synth'
+
+ defaults:
+ run:
+ shell: msys2 {0}
+
+ steps:
+ - name: '${{ matrix.sys.icon }} Setup MSYS2'
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.sys.sys }}
+ update: true
+ pacboy: >
+ diffutils:p
+ gcc:p
+ python-pip:p
+ python-setuptools:p
+
+ - name: '⚙ git config'
+ run: git config --global core.autocrlf input
+ shell: bash
+
+ - name: '🧰 Checkout'
+ uses: actions/checkout@v3
+
+ - name: '📥 Download artifact: package'
+ uses: actions/download-artifact@v3
+ with:
+ path: artifact
+ name: ${{ matrix.sys.sys }}-${{ matrix.sys.pkg }}
+
+ - name: '🛠 Install package and 🐍 Python dependencies'
+ run: |
+ pacman --noconfirm -U artifact/mingw-w64-*-ghdl-${{ matrix.sys.pkg }}-*.zst
+ pip3 install -r testsuite/requirements.txt
+
+ - name: '🚦 Test package'
+ run: GHDL=ghdl ./testsuite/testsuite.sh ${{ matrix.suite }}
diff --git a/.github/workflows/Windows-Standalone.yml b/.github/workflows/Windows-Standalone.yml
new file mode 100644
index 000000000..d7655141a
--- /dev/null
+++ b/.github/workflows/Windows-Standalone.yml
@@ -0,0 +1,166 @@
+name: Windows Standalone
+
+on:
+ workflow_call:
+
+jobs:
+
+
+#
+# Pure Windows Build (on MSYS2) - create zip (and also pre-wheel zip)
+#
+ Build:
+ name: '🚧${{ matrix.icon }} ${{ matrix.sys }} (pure-build)'
+ runs-on: windows-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32', arch: 'i686' }
+# - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64', arch: 'x86_64' } #! simulation with mcode is not yet supported on win64
+ - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64', arch: 'ucrt-x86_64' } #! experimental; simulation with mcode is not yet supported on win64
+
+ env:
+ MINGW_ARCH: ${{ matrix.sys }}
+ defaults:
+ run:
+ shell: msys2 {0}
+
+ steps:
+ - name: '${{ matrix.icon }} Setup MSYS2'
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.sys }}
+ update: true
+ install: base-devel git mingw-w64-${{matrix.arch}}-gcc-ada mingw-w64-${{matrix.arch}}-zlib zip
+ pacboy: >
+ toolchain:p
+ python-pip:p
+
+ - name: '⚙ git config'
+ run: git config --global core.autocrlf input
+ shell: bash
+
+ - name: '🧰 Checkout'
+ uses: actions/checkout@v3
+ with:
+ # The command 'git describe' (used for version) needs the history.
+ fetch-depth: 0
+
+ - name: '🚧 Build package'
+ run: |
+ pip3 install pefile
+ mkdir builddir
+ cd builddir
+ ../configure --prefix='/GHDL' LDFLAGS="-static -Wl,--stack=8388608" --enable-libghdl
+ make
+ mkdir -p 'GHDL'
+ make install DESTDIR=.
+ # No need to add dll dependencies for ghdl, as it is compiled
+ # with -static
+ make python-wheel
+ zip pre-wheel-${{matrix.sys}}.zip -r dist-wheel setup-standalone.py
+ zip ghdl-${{matrix.sys}}.zip -r GHDL
+
+ - name: '📤 Upload artifact: pre-wheel'
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ matrix.sys }}-pre-wheel
+ path: |
+ builddir/pre-wheel-${{matrix.sys}}.zip
+
+ - name: '📤 Upload artifact: zip pure-win'
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ matrix.sys }}-zip-win
+ path: |
+ builddir/ghdl-${{matrix.sys}}.zip
+
+
+ Test:
+ name: '🚦🐍🥡${{ matrix.icon }} ${{ matrix.sys }} (test sa)'
+ runs-on: windows-latest
+
+ needs:
+ - Build
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - {icon: '🟪', sys: 'MINGW32' }
+# - {icon: '🟦', sys: 'MINGW64' } #! simulation with mcode is not yet supported on win64
+# - {icon: '🟨', sys: 'UCRT64' } #! experimental; simulation with mcode is not yet supported on win64
+
+ defaults:
+ run:
+ shell: pwsh
+
+ steps:
+ - name: '📥 Download artifact: package'
+ uses: actions/download-artifact@v3
+ with:
+ path: artifact
+ name: ${{ matrix.sys }}-zip-win
+
+ - name: '⚙ Extract package'
+ run: |
+ dir
+ unzip artifact\ghdl-${{matrix.sys}}.zip
+ dir
+
+ - name: '🛠 Set envvars'
+ run: |
+ $GHDL_DIR = (pwd).Path + '\GHDL\bin'
+ echo "GHDL=${GHDL_DIR}\ghdl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
+ echo "$GHDL_DIR" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ dir $GHDL_DIR
+
+
+ - name: '🛠 Sanity check'
+ run: |
+ echo "GHDL is ${env:GHDL}"
+ dir ${env:GHDL}
+ & ${env:GHDL} version
+ echo "sha: ${{github.sha}}"
+ echo "head_ref: ${{github.head_ref}}"
+ echo "ref_name: ${{github.ref_name}}"
+
+ - name: '⚙ git config'
+ run: |
+ dir
+ dir ${env:GHDL}
+ git config --global core.autocrlf input
+
+ - name: '🧰 Checkout'
+ uses: actions/checkout@v3
+ with:
+ path: checkout
+
+ - name: '${{ matrix.icon }} Setup MSYS2'
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.sys }}
+ update: true
+ pacboy: >
+ diffutils:p
+ gcc:p
+
+ - name: '🚦 Testsuite for ghdl'
+ shell: msys2 {0}
+ run: |
+ set -x
+ pwd
+ ls -l
+ echo "PATH: $PATH"
+ echo "GHDL: $GHDL"
+ cygghdl="$(cygpath -u $GHDL)"
+ echo "cyg GHDL: $cygghdl"
+ $cygghdl -v
+ GHDL="$cygghdl"
+ PATH="$PATH:$(dirname $cygghdl)"
+ echo "PATH: $PATH"
+ ghdl version
+ cd checkout
+ ./testsuite/testsuite.sh gna
diff --git a/.github/workflows/Windows-pyGHDL.yml b/.github/workflows/Windows-pyGHDL.yml
new file mode 100644
index 000000000..f0f479763
--- /dev/null
+++ b/.github/workflows/Windows-pyGHDL.yml
@@ -0,0 +1,122 @@
+name: Windows pyGHDL
+
+on:
+ workflow_call:
+
+jobs:
+
+
+#
+# Pure Windows CPython pyGHDL platform wheel (from the pre-wheel zip)
+#
+ Build-wheel:
+ name: '🚦🐍${{ matrix.icon }} ${{ matrix.sys }} (pyGHDL-wheel)'
+ runs-on: windows-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - {icon: '🟪', sys: 'MINGW32', pyarch: x86 }
+# - {icon: '🟦', sys: 'MINGW64', pyarch: x64 }
+ - {icon: '🟨', sys: 'UCRT64', pyarch: x64 }
+
+ defaults:
+ run:
+ shell: pwsh
+
+ steps:
+ - name: '🐍 Setup Python'
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ architecture: ${{ matrix.pyarch }}
+
+ - name: '📥 Download artifact: package'
+ uses: actions/download-artifact@v3
+ with:
+ path: artifact
+ name: ${{ matrix.sys }}-pre-wheel
+
+ - name: '🐍 Build python wheel'
+ run: |
+ pip3 install wheel
+ pip3 install pyTooling
+ unzip artifact/pre-wheel-${{ matrix.sys }}.zip
+ python3 ./setup-standalone.py bdist_wheel
+ dir dist
+
+ - name: '🐍 Sanity check of the python wheel'
+ run: |
+ pip3 install -v (get-item dist\pyGHDL-*.whl)
+ dir -r ${env:Python3_ROOT_DIR}\Lib\site-packages\pyGHDL
+ python3 -m pyGHDL.cli.lsp --version
+ python3 -m pyGHDL.cli.dom version
+
+ - name: '📤 Upload artifact: wheel'
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ matrix.sys }}-wheel
+ path: |
+ dist/pyGHDL-*.whl
+
+ - name: '${{ matrix.icon }} Setup MSYS2'
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.sys }}
+ update: true
+
+
+ Test-wheel:
+ name: '🚦🐍🥡${{ matrix.icon }} ${{ matrix.sys }} (test sa py)'
+ runs-on: windows-latest
+
+ needs:
+ - Build-wheel
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - {icon: '🟪', sys: 'MINGW32', pyarch: x86 }
+# - {icon: '🟦', sys: 'MINGW64', pyarch: x64 }
+ - {icon: '🟨', sys: 'UCRT64', pyarch: x64 }
+
+ defaults:
+ run:
+ shell: pwsh
+
+ steps:
+ - name: '🐍 Setup Python'
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ architecture: ${{ matrix.pyarch }}
+
+ - name: '📥 Download artifact: package'
+ uses: actions/download-artifact@v3
+ with:
+ path: artifact
+ name: ${{ matrix.sys }}-wheel
+
+ - name: '🐍 Sanity check of the python wheel'
+ run: |
+ pip3 install -v (get-item artifact\pyGHDL-*.whl)
+
+ - name: '⚙ git config'
+ run: |
+ dir
+ dir ${env:GHDL}
+ git config --global core.autocrlf input
+
+ - name: '🧰 Checkout'
+ uses: actions/checkout@v3
+ with:
+ path: checkout
+
+ - name: '🚦 pyunit tests'
+ run: |
+ pip3 install pytest
+ dir checkout
+ cd checkout/testsuite
+ python3 -m pytest pyunit