]> granicus.if.org Git - libevent/commitdiff
github workflows: test for mingw via cmake
authoryuangongji <yuangongji@foxmail.com>
Sun, 22 Mar 2020 05:51:46 +0000 (13:51 +0800)
committeryuangongji <yuangongji@foxmail.com>
Sun, 22 Mar 2020 14:23:19 +0000 (22:23 +0800)
.github/workflows/mingw.yml

index 98241a9ed2a99d6c70c58b1791b06122886763b4..80cdf8baa7c16e4f890586e1b1345dbe8ab203b3 100644 (file)
@@ -19,8 +19,8 @@ on:
       - 'LICENSE'
 
 jobs:
-  windows:
-    runs-on: windows-2016
+  autotools:
+    runs-on: windows-2019
     strategy:
       fail-fast: false
       matrix:
@@ -36,13 +36,13 @@ jobs:
 
       - name: Cache MinGW
         id: cache-mingw
-        uses: actions/cache@v1.0.3
+        uses: actions/cache@v1.1.2
         with:
           path: D:\a\_temp\msys
           key: windows-mingw
 
       - name: Cache Build
-        uses: actions/cache@v1.0.3
+        uses: actions/cache@v1.1.2
         with:
           path: build
           key: mingw-${{ matrix.EVENT_MATRIX }}
@@ -55,7 +55,7 @@ jobs:
       - name: Install Dependes
         if: steps.cache-mingw.outputs.cache-hit != 'true'
         run: |
-          msys2do pacman -S --noconfirm mingw-w64-x86_64-gcc make autoconf automake libtool mingw-w64-x86_64-openssl
+          msys2do pacman -S --noconfirm mingw-w64-x86_64-gcc autoconf automake libtool mingw-w64-x86_64-openssl
 
       - name: Build And Test
         shell: powershell
@@ -86,3 +86,61 @@ jobs:
         with:
           name: mingw-${{ matrix.EVENT_MATRIX }}-build
           path: build
+
+  cmake:
+    runs-on: windows-2019
+    strategy:
+      fail-fast: false
+      matrix:
+        EVENT_MATRIX:
+          - NONE
+          - DISABLE_OPENSSL
+          - DISABLE_THREAD_SUPPORT
+          - DISABLE_DEBUG_MODE
+          - DISABLE_MM_REPLACEMENT
+
+    steps:
+      - uses: actions/checkout@v2.0.0
+
+      - name: Cache MinGW
+        id: cache-mingw-cmake
+        uses: actions/cache@v1.1.2
+        with:
+          path: D:\a\_temp\msys
+          key: windows-mingw-cmake
+
+      - name: Cache Build
+        uses: actions/cache@v1.1.2
+        with:
+          path: build
+          key: mingw-cmake-${{ matrix.EVENT_MATRIX }}
+
+      - uses: numworks/setup-msys2@v1
+        if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
+        with:
+          msystem: MINGW64
+
+      - name: Install Dependes
+        if: steps.cache-mingw-cmake.outputs.cache-hit != 'true'
+        run: |
+          msys2do pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-openssl
+
+      - name: Build And Test
+        shell: powershell
+        run: |
+          $EVENT_CONFIGURE_OPTIONS=""
+          if ( "${{ matrix.EVENT_MATRIX }}" -ne "NONE" ) {
+            $EVENT_CONFIGURE_OPTIONS="-DEVENT__${{ matrix.EVENT_MATRIX }}=ON"
+          }
+          $env:PATH="D:\a\_temp\msys\msys64\mingw64\bin;D:\a\_temp\msys\msys64\usr\bin;$env:PATH"
+          mkdir build -ea 0
+          cd build
+          cmake .. -G "MSYS Makefiles" $EVENT_CONFIGURE_OPTIONS -DCMAKE_C_FLAGS=-w
+          cmake --build .
+          ctest -V
+
+      - uses: actions/upload-artifact@v1
+        if: failure()
+        with:
+          name: mingw-${{ matrix.EVENT_MATRIX }}-build
+          path: build