From f81eb03349624f9b41f5d818c3bab1242ad2e165 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 5 Jul 2021 23:53:57 +0200 Subject: [PATCH] ci: test on mingw-w64 --- .github/workflows/build-mingw.yml | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/build-mingw.yml diff --git a/.github/workflows/build-mingw.yml b/.github/workflows/build-mingw.yml new file mode 100644 index 0000000..f9326f5 --- /dev/null +++ b/.github/workflows/build-mingw.yml @@ -0,0 +1,59 @@ +name: Build using cmake+msys2+mingw(32|64) +on: + pull_request: + push: + release: + types: published +jobs: + build-mingw: + strategy: + matrix: + arch: ['i686', 'x86_64'] + platform: ['gl3-glfw', 'gl3-sdl2', 'd3d9'] + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: "Calculate variables" + id: "variables" + shell: python + run: | + cmake_args = { + "gl3-glfw": "-DLIBRW_PLATFORM=GL3 -DLIBRW_GL3_GFXLIB=GLFW", + "gl3-sdl2": "-DLIBRW_PLATFORM=GL3 -DLIBRW_GL3_GFXLIB=SDL2", + "d3d9": "-DLIBRW_PLATFORM=D3D9" + }["${{ matrix.platform }}"] + print("::set-output name=cmake_args::{}".format(cmake_args)) + msystem = { + "i686": "MINGW32", + "x86_64": "MINGW64", + }["${{ matrix.arch }}"] + print("::set-output name=msystem::{}".format(msystem)) + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{ steps.variables.outputs.msystem }} + install: >- + mingw-w64-${{ matrix.arch }}-gcc + mingw-w64-${{ matrix.arch }}-cmake + mingw-w64-${{ matrix.arch }}-make + mingw-w64-${{ matrix.arch }}-glfw + mingw-w64-${{ matrix.arch }}-SDL2 + - name: "Build files (CMake)" + shell: "msys2 {0}" + run: | + cmake -S. -Bbuild ${{ steps.variables.outputs.cmake_args }} -DLIBRW_INSTALL=True -G "MinGW Makefiles" + cmake --build build --parallel + - name: "Create binary package (CPack)" + shell: "msys2 {0}" + working-directory: ./build + run: | + cpack + - name: "Archive binary package (github artifacts)" + uses: actions/upload-artifact@v2 + with: + name: "mingw-${{ matrix.platform }}-${{ matrix.arch }}" + path: build/*.tar.xz + if-no-files-found: error