Skip to content

Commit

Permalink
Building GHDL in pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Nov 13, 2024
1 parent be80c18 commit 8ef5524
Showing 1 changed file with 244 additions and 1 deletion.
245 changes: 244 additions & 1 deletion .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,253 @@ jobs:
with:
name: pyEDAA.CLITool

CompileUbuntu:
name: Compile GHDL on Ubuntu 2024.04 (LTS)
runs-on: "ubuntu-24.04"

strategy:
fail-fast: false
matrix:
backend: [mcode, llvm]

defaults:
run:
shell: bash

steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
with:
repository: ghdl/ghdl

- name: 🔧 Install dependencies
run: |
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='llvm clang' || unset LLVM_ARGS
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc g++ gnat $LLVM_ARGS
- name: Prepare build environemnt
run: |
mkdir -p build/${{ matrix.backend }}
./configure --help
- name: ⚙ Configure
run: |
cd build/${{ matrix.backend }}
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='--with-llvm-config' || unset LLVM_ARGS
NPROC=$(nproc)
GNATMAKE="gnatmake -j$NPROC" \
MAKE="make -j$NPROC" \
../../configure --prefix=/opt/ghdl-${{ matrix.backend }} $LLVM_ARGS
- name: 🔨 Make
run: |
cd build/${{ matrix.backend }}
make
- name: 📋 Install
run: |
cd build/${{ matrix.backend }}
sudo make install
- name: 📤 Upload 'GHDL' artifact
uses: actions/upload-artifact@v4
with:
name: ghdl-ubuntu-24.04-x86_64-${{ matrix.backend }}
path: /opt/ghdl-${{ matrix.backend }}/
if-no-files-found: error
retention-days: 1

CompileMacOS:
name: Compile GHDL on macOS 14.0 (aarch64)
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
backend: [llvm] # mcode

env:
GNAT_ARCH: "aarch64"
GNAT_VERSION: "14.1.0-3"

defaults:
run:
shell: bash

steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
with:
repository: ghdl/ghdl

- name: Install dependencies
run: |
brew install llvm
echo "LLVM_BINARY_PATH=$(brew --prefix llvm)/bin" >> $GITHUB_ENV
- name: Install GNAT
run: |
GNAT_NAME="gnat-${{ env.GNAT_ARCH }}-darwin-${{ env.GNAT_VERSION }}"
GNAT_URL="https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-${{ env.GNAT_VERSION }}/${GNAT_NAME}.tar.gz"
echo "Downloading GNAT ${{ env.GNAT_VERSION }} (${{ env.GNAT_ARCH }}) from '$GNAT_URL'"
wget -q --show-progress --progress=bar:force:noscroll -O GNAT.tar.gz "$GNAT_URL"
test $? -ne 0 && echo -e "ERROR: Downloading '$GNAT_URL'" && exit 1
ls -lAh
tar -zxf GNAT.tar.gz && rm GNAT.tar.gz
test $? -ne 0 && echo -e "ERROR: Extracting 'GNAT.tar.gz'" && exit 1
mv ${GNAT_NAME} gnat
echo "ls gnat"
ls -lAh gnat
echo "ls gnat/bin"
ls -lAh gnat/bin
./gnat/bin/gnatls -v
echo "PWD: $(pwd)"
ls -lAh $(pwd)/gnat
ls -lAh $(pwd)/gnat/bin
echo "GNAT_BINARY_PATH=$(pwd)/gnat/bin" >> $GITHUB_ENV
- name: Prepare build environemnt
run: |
mkdir -p build/${{ matrix.backend }}
echo $PATH
echo "PATH=$GNAT_BINARY_PATH:$LLVM_BINARY_PATH:$PATH" >> $GITHUB_ENV
- name: Check build environemnt
run: |
echo $PATH
ls -lAh $(pwd)
ls -lAh /Users/runner/work/pyEDAA.CLITool/pyEDAA.CLITool/gnat/bin
echo "which gnat: $(which gnat) ($($(which gnat) --version))"
echo "which gnatmake: $(which gnatmake) ($($(which gnatmake) --version))"
echo "which llvm-config: $(which llvm-config) ($($(which llvm-config) --version))"
- name: ⚙ Configure
run: |
cd build/${{ matrix.backend }}
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='--with-llvm-config' || unset LLVM_ARGS
# Use static libs (including libzstd) and dead-strip (to avoid libz3)
libzstd=$(brew --prefix zstd)/lib/libzstd.a
export LLVM_LDFLAGS="$(llvm-config --link-static --libfiles --system-libs | sed -e s@-lzstd@$libzstd@) -Wl,-dead_strip,-dead_strip_dylibs"
echo $LLVM_LDFLAGS
# Use classic ld and not lld (which simply crashes)
NPROC=$(sysctl -n hw.logicalcpu)
GNATMAKE="gnatmake -j$NPROC" \
MAKE="make -j$NPROC" \
LDFLAGS=-Wl,-ld_classic \
../../configure --prefix=/opt/ghdl-${{ matrix.backend }} $LLVM_ARGS
- name: 🔨 Make
run: |
cd build/${{ matrix.backend }}
make
- name: 📋 Install
run: |
cd build/${{ matrix.backend }}
sudo make install
- name: 📤 Upload 'GHDL' artifact
uses: actions/upload-artifact@v4
with:
name: ghdl-macos-14.0-aarch64-${{ matrix.backend }}
path: /opt/ghdl-${{ matrix.backend }}/
if-no-files-found: error
retention-days: 1

CompileWindows:
name: Compile GHDL on Windows Server
runs-on: windows-latest

env:
msys2_packages: "make"
common_packages: "gcc:p gcc-ada:p diffutils:p"
mcode_packages: ""
llvm_packages: "llvm:p clang:p"

strategy:
fail-fast: false
matrix:
runtime: [mingw64, ucrt64]
backend: [mcode, llvm]

defaults:
run:
shell: "msys2 {0}"

steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
with:
repository: ghdl/ghdl

- name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.runtime }}
update: true
install: ${{ env.msys2_packages }}
pacboy: "${{ env.common_packages }} ${{ env.mcode_packages }} ${{ env.llvm_packages }}"

- name: Check build environemnt
run: |
echo "which gnat: $(which gnat) ($($(which gnat) --version))"
echo "which gnatmake: $(which gnatmake) ($($(which gnatmake) --version))"
echo "which llvm-config: $(which llvm-config) ($($(which llvm-config) --version))"
- name: Prepare build environemnt
run: |
mkdir -p build/${{ matrix.backend }}
mkdir -p install
- name: ⚙ Configure
run: |
cd build/${{ matrix.backend }}
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='--with-llvm-config' || unset LLVM_ARGS
NPROC=$(nproc)
GNATMAKE="gnatmake -j$NPROC" \
MAKE="make -j$NPROC" \
../../configure --prefix=../../install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }} $LLVM_ARGS
- name: 🔨 Make
run: |
cd build/${{ matrix.backend }}
make
- name: 📋 Install
run: |
cd build/${{ matrix.backend }}
make install
- name: Debug
run: |
ls -lAh ./install
ls -lAh ./install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }}
ls -lAh ./install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }}/bin
- name: 📤 Upload 'GHDL' artifact
uses: actions/upload-artifact@v4
with:
name: ghdl-windows-${{ matrix.runtime }}-${{ matrix.backend }}
path: ./install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }}/
if-no-files-found: error
retention-days: 1

UnitTesting:
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
needs:
- UnitTestingParams
# - CompileUbuntu
- CompileMacOS
- CompileWindows
with:
jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }}
apt: ghdl-mcode
Expand Down Expand Up @@ -125,6 +368,7 @@ jobs:
needs:
- ConfigParams
- UnitTestingParams
- ConfigParams
- PublishTestResults
- PublishCoverageResults
# - VerifyDocs
Expand All @@ -147,7 +391,6 @@ jobs:
sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-
xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-


PDFDocumentation:
uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev
needs:
Expand Down

0 comments on commit 8ef5524

Please sign in to comment.