diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d817e8e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,132 @@ +name: Build & Run + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + Linux: + runs-on: ubuntu-latest + container: opensuse/tumbleweed + + strategy: + fail-fast: true + + steps: + - name: Install prerequisites + run: | + zypper -n in wine msitools awk cmake ninja make gcc14-c++ clang lld libc++-devel + ln -s /usr/bin/gcc-14 /usr/local/bin/gcc + ln -s /usr/bin/g++-14 /usr/local/bin/g++ + mkdir $HOME/.wine # wine: '/github/home' is not owned by you, refusing to create a configuration directory there + + - name: Checkout msvc-wine + uses: actions/checkout@v4 + with: + repository: mstorsjo/msvc-wine + path: msvc-wine + + - name: Install msvc-wine + run: | + mkdir /opt/msvc + cd msvc-wine + ./vsdownload.py --accept-license --preview --dest /opt/msvc + ./install.sh /opt/msvc + + - uses: actions/checkout@v4 + + - name: gcc + run: make gcc LAUNCHER=./ + + - name: cmake gcc + run: cmake -P workflow.cmake -- gcc + + - name: clang + run: make clang LAUNCHER=./ + + - name: cmake clang + run: cmake -P workflow.cmake -- clang + + - name: clang-cl + run: make clang-cl CXXFLAGS="-winsysroot /opt/msvc -fuse-ld=lld" LAUNCHER="WINEDEBUG=-all wine64 " + + - name: msvc-wine + run: PATH=/opt/msvc/bin/x64:$PATH make msvc LAUNCHER="WINEDEBUG=-all wine64 " VCTOOLSINSTALLDIR=/opt/msvc + + - name: cmake msvc-wine + run: cmake -P workflow.cmake -- msvc-wine + + + Windows: + runs-on: windows-latest + + strategy: + fail-fast: true + + steps: + - name: Install prerequisites + run: | + choco upgrade --no-progress llvm + choco install --no-progress ninja + + Add-Content $env:GITHUB_PATH C:\ + Set-Content C:\vsdevcmd.cmd @" + @echo off + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + rename %1 %~nx1.bat + %1.bat + "@ + + - uses: msys2/setup-msys2@v2 + with: + msystem: MSYS + release: false + update: true + install: >- + make + ucrt64/mingw-w64-ucrt-x86_64-gcc + clang64/mingw-w64-clang-x86_64-clang + + - uses: actions/checkout@v4 + + - name: msvc + shell: vsdevcmd {0} + run: nmake -nologo msvc + + - name: cmake msvc + shell: vsdevcmd {0} + run: cmake -P workflow.cmake -- default + + - name: msbuild + run: cmake -P workflow.cmake -- msbuild + + - name: clang + shell: vsdevcmd {0} + run: nmake -nologo clang-win32 + + - name: cmake clang + run: cmake -P workflow.cmake -- clang + + - name: clang-cl + shell: vsdevcmd {0} + run: nmake -nologo clang-cl + + - name: mingw-ucrt64 + shell: msys2 {0} + env: + MSYSTEM: UCRT64 + run: make gcc LAUNCHER=./ + + - name: cmake mingw-ucrt64 + if: false + run: cmake -P workflow.cmake -- mingw-ucrt64 + + - name: mingw-clang64 + shell: msys2 {0} + env: + MSYSTEM: CLANG64 + run: make clang-mingw LAUNCHER=./ + + - name: cmake mingw-clang64 + run: cmake -P workflow.cmake -- mingw-clang64