Skip to content

feat(dto-compiler): Lay the foundations of a parser implementation #143

feat(dto-compiler): Lay the foundations of a parser implementation

feat(dto-compiler): Lay the foundations of a parser implementation #143

Workflow file for this run

name: "Build and continuous Package"
on:
push:
branches:
- '**'
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches:
- master
- "release/**"
jobs:
style:
name: "Style checks"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: "Code style (clang-format)"
id: clang-format
uses: jidicula/[email protected]
with:
check-path: src
# docs:
# name: "Documentation"
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v3
# - name: "Install dependencies"
# run: |
# sudo apt-get -y update
# sudo apt-get -y install \
# doxygen \
# graphviz
# - name: "Prepare build with CMake"
# run: |
# cmake --version
#
# cmake -S . -B Build \
# -DCMAKE_BUILD_TYPE=Debug \
# -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF \
# -DMONOMUX_BUILD_DOCS=ON \
# -DMONOMUX_BUILD_SHARED_LIBS=OFF \
# -DMONOMUX_BUILD_TESTS=OFF \
# -DMONOMUX_NON_ESSENTIAL_LOGS=ON
# - name: "Doxygen"
# run: |
# cmake --build ./Build -- -j docs
# - name: "Upload artefacts: Doxygen"
# uses: actions/upload-artifact@v3
# with:
# path: "Build/docs/html"
# name: "Implementation reference"
# if-no-files-found: warn
# retention-days: 14
lts-linux:
strategy:
fail-fast: false
matrix:
distribution: [
# "ubuntu-18.04",
"ubuntu-20.04",
"ubuntu-22.04"
]
compiler: [
"gcc",
"clang"
]
library-type: [
"static",
"shared",
"unity"
]
name: "${{ matrix.distribution }}, ${{ matrix.compiler }}, ${{ matrix.library-type }} libs"
runs-on: ${{ matrix.distribution }}
steps:
- uses: actions/checkout@v3
- name: "Install dependencies"
id: dependencies
env:
COMPILER: ${{ matrix.compiler }}
DISTRO: ${{ matrix.distribution }}
shell: bash
run: .github/scripts/get-dependencies.sh
- name: "Prepare build with CMake"
env:
CC: ${{ steps.dependencies.outputs.CC }}
CXX: ${{ steps.dependencies.outputs.CXX }}
run: |
cmake --version
cmake -S . -B Build \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DMONOMUX_BUILD_SHARED_LIBS=${{ (matrix.library-type == 'static' || matrix.library-type == 'unity') && 'OFF' || 'ON' }} \
-DMONOMUX_BUILD_UNITY=${{ matrix.library-type == 'unity' && 'ON' || 'OFF' }} \
-DMONOMUX_BUILD_TESTS=${{ matrix.library-type == 'unity' && 'OFF' || 'ON' }}
- name: "Build"
run: |
cmake --build ./Build -- -j
- name: "Self-check the feature set of the binary"
run: |
./Build/monomux -VV
echo
echo "?> Are we the right library type..."
./Build/monomux -VV | grep "^ \* " | grep "library$" | \
grep -i "${{ matrix.library-type }}"
- name: "Test"
if: matrix.library-type != 'unity'
run: |
cmake --build ./Build -- -j check
- name: "Package"
id: binary-package
continue-on-error: true
run: |
cd Build
echo "::group::Tarball"
cpack -V -G TGZ
echo "::endgroup::"
echo "::group::Debian package"
cpack -V -G DEB
echo "::endgroup::"
ls -alh
cd ..
echo "PACKAGE_VERSION=$(cat Build/Version.txt)" >> "$GITHUB_OUTPUT"
mv -v Build/MonoMux-*-Linux-MonomuxUserGroup.tar.gz \
"./monomux-$(cat Build/Version.txt)-${{ matrix.distribution }}-${{ matrix.compiler }}.tgz"
mv -v Build/MonoMux-*-Linux-MonomuxUserGroup.deb \
"./monomux-$(cat Build/Version.txt)-${{ matrix.distribution }}-${{ matrix.compiler }}.deb"
mv -v Build/MonoMux-*-Linux-MonomuxUserGroup-dbgsym.ddeb \
"./monomux-dbgsym-$(cat Build/Version.txt)-${{ matrix.distribution }}-${{ matrix.compiler }}.ddeb"
- name: "Check whether the Debian package is installable"
id: deb-install
# This condition is disabled so running the CI locally via `act` executes this, and further, step.
# if: steps.binary-package.outcome == 'success'
run: |
if [[ "${{ steps.binary-package.outcome }}" == "success" ]]
then
sudo apt-get -fy install \
"./monomux-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.deb"
sudo apt-get -fy install \
"./monomux-dbgsym-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.ddeb"
else
echo "::warning title=Debian Package self-check skipped::The package failed to assemble and thus wasn't tested."
fi
- name: "Upload packaging errors for triage"
if: steps.binary-package.outcome == 'failure' && matrix.compiler == 'clang' && matrix.library-type == 'unity'
uses: actions/upload-artifact@v3
with:
path: "Build/_CPack_Packages"
name: "${{ matrix.distribution }}-${{ matrix.compiler }} packaging fail"
if-no-files-found: ignore
retention-days: 7
- name: "Upload binary package artefacts: Tarball"
if: steps.binary-package.outcome == 'success' && matrix.compiler == 'clang' && matrix.library-type == 'unity'
uses: actions/upload-artifact@v3
with:
path: "monomux-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.tgz"
name: "monomux-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.tgz"
if-no-files-found: warn
retention-days: 30
- name: "Upload binary package artefacts: Debian package"
if: steps.binary-package.outcome == 'success' && matrix.compiler == 'clang' && matrix.library-type == 'unity'
uses: actions/upload-artifact@v3
with:
path: "monomux-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.deb"
name: "monomux-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.deb"
if-no-files-found: warn
retention-days: 30
- name: "Upload binary package artefacts: Debian package (debug symbols)"
if: steps.binary-package.outcome == 'success' && matrix.compiler == 'clang' && matrix.library-type == 'unity'
uses: actions/upload-artifact@v3
with:
path: "monomux-dbgsym-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.ddeb"
name: "monomux-dbgsym-${{ steps.binary-package.outputs.PACKAGE_VERSION }}-${{ matrix.distribution }}-${{ matrix.compiler }}.ddeb"
if-no-files-found: warn
retention-days: 30