Ensure generated code is present #741
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows | |
on: | |
push: | |
paths: | |
- '.github/workflows/windows.yml' | |
- 'CMakeLists.txt' | |
- 'src/**' | |
- 'test/**' | |
- 'modules/**' | |
- '3rdparty/**' | |
pull_request: | |
paths: | |
- '.github/workflows/windows.yml' | |
- 'CMakeLists.txt' | |
- 'src/**' | |
- 'test/**' | |
- 'modules/**' | |
- '3rdparty/**' | |
release: | |
types: published | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
# ClangCL is known to fail against SDL2-2.0.16 because of the use of -idirafter. | |
# MinGW fails due to incomprehensible linker errors... LTO maybe? | |
# LLVM-Clang fails due to cmake configuration issues in newton-dynamics. | |
# compiler: [msvc, clangcl, mingw, clang] | |
compiler: [msvc] | |
config: [Release, Debug] | |
image: [windows-2019, windows-2022] | |
runs-on: ${{ matrix.image }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
# Don't change this to use v1. It doesn't work correctly with the github "major version" auto-magic | |
- uses: hendrikmuhs/[email protected] | |
with: | |
Key: windows-${{ matrix.image }}-${{ matrix.config }} | |
- uses: egor-tensin/setup-mingw@v2 | |
if: ${{ matrix.compiler == 'mingw' }} | |
- uses: egor-tensin/setup-clang@v1 | |
if: ${{ matrix.compiler == 'clang' }} | |
- uses: ashutoshvarma/[email protected] | |
if: ${{ matrix.compiler == 'clang' }} | |
- name: Configure (MSVC) | |
if: ${{ matrix.compiler == 'msvc' }} | |
run: | | |
cmake -B build -DCMAKE_CONFIGURATION_TYPES=${{ matrix.config }} | |
- name: Configure (ClangCL) | |
if: ${{ matrix.compiler == 'clangcl' }} | |
run: | | |
cmake -B build -DCMAKE_CONFIGURATION_TYPES=${{ matrix.config }} -TClangCL | |
- name: Configure (MinGW) | |
if: ${{ matrix.compiler == 'mingw' }} | |
env: | |
CC: C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\cc.exe | |
CXX: C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\c++.exe | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -G"MinGW Makefiles" | |
- name: Configure (Clang) | |
if: ${{ matrix.compiler == 'clang' }} | |
env: | |
CC: C:\Program Files\LLVM\bin\cc.exe | |
CXX: C:\Program Files\LLVM\bin\c++.exe | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -GNinja | |
- name: Compile Dependencies | |
run: | | |
cmake --build build --parallel --config ${{ matrix.config }} --target compile-osp-magnum-deps compile-test-deps | |
- name: Compile OSP-Magnum | |
run: | | |
cmake --build build --parallel --config ${{ matrix.config }} --target osp-magnum | |
- name: Compile Unit Tests | |
run: | | |
cmake --build build --parallel --config ${{ matrix.config }} --target compile-tests | |
# MSVC Generator doesn't support the special target "test" like Ninja generator does on linux. | |
- name: Run Unit Tests | |
run: | | |
ctest --schedule-random --progress --output-on-failure --parallel --no-tests error --build-config ${{ matrix.config }} --test-dir build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: OSP-${{ matrix.image }}-${{ matrix.config }}-${{ matrix.compiler }} | |
path: build\${{ matrix.config }} |