Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15 fetching areg-sdk in cmake #16

Merged
merged 11 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 161 additions & 67 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,101 +24,195 @@ jobs:
matrix:
config: # Create matrix with combinations
# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs
- { name: linux-gnu-shared-ext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON}
- { name: linux-gnu-g++-shared,
os: ubuntu-latest,
lib: shared,
family: gnu,
cxx: g++,
comp: ON,
before: ON
}

# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and no logs
- { name: linux-gnu-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: OFF}
- { name: linux-gnu-g++-static,
os: ubuntu-latest,
lib: static,
family: gnu,
cxx: g++,
comp: OFF,
before: OFF
}

# compile AREG engine as a static library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs
- { name: linux-gnu-static-ext-log, os: ubuntu-latest, lib: static, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON}
- { name: linux-gnu-gcc-shared,
os: ubuntu-latest,
lib: shared,
family: gnu,
cxx: gcc,
comp: OFF,
before: ON
}

# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and logs
- { name: linux-gnu-shared-noext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: ON}
# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and no logs
- { name: linux-gnu-shared-noext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: OFF}
- { name: linux-gnu-gcc-static,
os: ubuntu-latest,
lib: shared,
family: gnu,
cxx: gcc,
comp: ON,
before: OFF
}

# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs
- { name: linux-llvm-clang++-shared,
os: ubuntu-latest,
lib: shared,
family: llvm,
cxx: clang++,
comp: ON,
before: ON
}

# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs
- { name: linux-llvm-clang++-static,
os: ubuntu-latest,
lib: static,
family: llvm,
cxx: clang++,
comp: OFF,
before: OFF
}

# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs
- { name: linux-clang-shared-ext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON}
- { name: linux-llvm-clang-shared,
os: ubuntu-latest,
lib: shared,
family: llvm,
cxx: clang,
comp: OFF,
before: ON
}

# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs
- { name: linux-clang-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: OFF}
# compile AREG engine as a static library with clang on Ubuntu Linux, enable AREG extensions and logs
- { name: linux-clang-static-ext-log, os: ubuntu-latest, lib: static, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON}
# compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and logs
- { name: linux-clang-shared-noext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: ON}
# compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and no logs
- { name: linux-clang-shared-noext-nolog,os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: OFF}
- { name: linux-llvm-clang-static,
os: ubuntu-latest,
lib: static,
family: llvm,
cxx: clang,
comp: ON,
before: OFF
}

# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
- { name: win-cygwin-g++-shared,
os: windows-latest,
lib: shared,
family: cygwin,
cxx: g++,
comp: ON,
before: ON
}

# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
- { name: win-cygwin-g++-static,
os: windows-latest,
lib: static,
family: cygwin,
cxx: g++,
comp: OFF,
before: OFF
}

# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
- { name: win-cygwin-gcc-shared,
os: windows-latest,
lib: shared,
family: cygwin,
cxx: gcc,
comp: OFF,
before: ON
}

# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
- { name: win-cygwin-shared-ext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON}
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and no logs
- { name: win-cygwin-shared-ext-nolog, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: OFF}
# compile AREG engine as a static with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
- { name: win-cygwin-static-ext-log, os: windows-latest, lib: static, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON}
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and logs
- { name: win-cygwin-shared-noext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: ON}
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and no logs
- { name: win-cygwin-shared-noext-nolog,os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: OFF}
- { name: win-cygwin-gcc-static,
os: windows-latest,
lib: static,
family: cygwin,
cxx: gcc,
comp: ON,
before: OFF
}

# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs
- { name: win-msvc-shared-ext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON}
# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs
- { name: win-msvc-shared-ext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: OFF}
# compile AREG engine as a static with MSVC on Windows, enable AREG extensions and logs
- { name: win-msvc-static-ext-log, os: windows-latest, lib: static, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON}
- { name: win-msvc-cl-shared,
os: windows-latest,
lib: shared,
family: msvc,
cxx: cl,
comp: ON,
before: ON
}

# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs
- { name: win-msvc-shared-noext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: ON}
# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs
- { name: win-msvc-shared-noext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: OFF}
- { name: win-msvc-cl-static,
os: windows-latest,
lib: static,
family: msvc,
cxx: cl,
comp: OFF,
before: OFF
}

steps:

- name: Checkout AREG engine (AREG SDK) source codes and dependencies
uses: actions/checkout@v3
- name: Checkout AREG SDK Demo project sources and dependencies
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Java JDK to run code generator
uses: actions/[email protected]
with:
java-version: 17
java-package: jre
distribution: temurin

- name: Update compilers on Linux
if: matrix.config.os == 'ubuntu-latest'
# Update compilers, set C/C++ compilers
run: |
sudo apt-get update
export CC=/usr/bin/${{matrix.config.cc}} CXX=/usr/bin/${{matrix.config.cxx}}
run: sudo apt-get update

- name: Fetch cygwin installer on Windows
- name: Set Windows PATH environment variable for cygwin
if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin'
shell: powershell
run: Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile C:\setup.exe
run: echo "PATH=C:\cygwin;C:\cygwin\bin;C:\cygwin\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Install cygwin on Windows
if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin'
shell: cmd
run: |
c:\setup.exe -qgnO -s http://mirrors.kernel.org/sourceware/cygwin/ -l C:\cygwin-packages\ -P ^
cmake,^
dos2unix,^
extra-cmake-modules,^
flexdll,^
gcc-g++,^
make,^
ncurses,^
libncurses-devel

- name: set Windows PATH environment variable
if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin'
run: echo "PATH=C:\cygwin64;C:\cygwin64\bin;C:\cygwin64\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Configure CMake with enabled extended feature and selected compiler family
if: matrix.config.extend == 'ON'
uses: cygwin/cygwin-install-action@v4
with:
packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make

- name: Set cmake cache destination for Linux
if: matrix.config.os == 'ubuntu-latest'
run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV"

- name: Set cmake cache destination for Windows
if: matrix.config.os == 'windows-latest'
run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> $env:GITHUB_ENV

- name: Configure CMake and pass compiler option
if: matrix.config.comp == 'ON'
working-directory: ${{github.workspace}}
run: |
cmake -B ./build -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}}
cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER=${{matrix.config.cxx}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}}

- name: Configure CMake for disabled extended feature and selected compiler
if: matrix.config.extend == 'OFF'
- name: Configure CMake and pass compiler family option
if: matrix.config.comp == 'OFF'
working-directory: ${{github.workspace}}
run: |
cmake -B ./build -DAREG_COMPILER=${{matrix.config.cc}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}}
cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}}

- name: Build with CMake
working-directory: ${{github.workspace}}
# Build your program with the given configuration
run: cmake --build ./build -j10

- name: Run Unit Tests
working-directory: ${{github.workspace}}
run: ctest --test-dir ./build --output-on-failure --output-junit test_results.xml

run: cmake --build ${{env.CACHE_DEST}} -j 20
35 changes: 21 additions & 14 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,27 @@ jobs:
- {name: MSBuild-x64-noext-nolog, platform: x64, extend: 0, logs: 0}

steps:
- name: Checkout AREG engine (AREG SDK) source codes and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout AREG SDK Demo project sources and dependencies
uses: actions/checkout@v4
with:
submodules: recursive

- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Setup Java JDK to run code generator
uses: actions/[email protected]
with:
java-version: 17
java-package: jre
distribution: temurin

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build areg-sdk solution.
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}}
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build areg-sdk solution.
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}}
Loading
Loading