瀏覽代碼

enable shared tests on ci

ruki 4 年之前
父節點
當前提交
12e2f9a354

+ 2 - 2
.github/workflows/android.yml

@@ -18,12 +18,12 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: prepare
+      - name: Prepare
         run: |
           wget -q https://dl.google.com/android/repository/android-ndk-r21-linux-x86_64.zip
           unzip -q -o ./android-ndk-r21-linux-x86_64.zip
 
-      - name: tests
+      - name: Tests
         run: |
           xmake l ./scripts/test.lua -D -p android --ndk=`pwd`/android-ndk-r21
 

+ 1 - 1
.github/workflows/iphoneos.yml

@@ -18,6 +18,6 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: tests
+      - name: Tests
         run: |
           xmake l ./scripts/test.lua -D -p iphoneos

+ 4 - 1
.github/workflows/linux.yml

@@ -18,7 +18,10 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: tests
+      - name: Tests (Static)
         run: |
           xmake l ./scripts/test.lua -D
 
+      - name: Tests (Shared)
+        run: |
+          xmake l ./scripts/test.lua -D --shared

+ 5 - 1
.github/workflows/macos.yml

@@ -18,6 +18,10 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: tests
+      - name: Tests (Static)
         run: |
           xmake l ./scripts/test.lua -D
+
+      - name: Tests (Shared)
+        run: |
+          xmake l ./scripts/test.lua -D --shared

+ 5 - 1
.github/workflows/mingw.yml

@@ -22,6 +22,10 @@ jobs:
         run: |
           brew install mingw-w64
 
-      - name: tests
+      - name: Tests (Static)
         run: |
           xmake l ./scripts/test.lua -D -p mingw
+
+      - name: Tests (Shared)
+        run: |
+          xmake l ./scripts/test.lua -D -p mingw --shared

+ 5 - 1
.github/workflows/windows.yml

@@ -18,6 +18,10 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: tests 
+      - name: Tests (Static)
         run: |
           xmake l ./scripts/test.lua -D
+
+      - name: Tests (Shared)
+        run: |
+          xmake l ./scripts/test.lua -D --shared

+ 6 - 1
scripts/test.lua

@@ -9,6 +9,7 @@ local options =
     {'v', "verbose",    "k",  nil, "Enable verbose information."     }
 ,   {'D', "diagnosis",  "k",  nil, "Enable diagnosis information."   }
 ,   {nil, "shallow",    "k",  nil, "Only install the root packages." }
+,   {nil, "shared",     "k",  nil, "Enable shared library."          }
 ,   {'p', "plat",       "kv", nil, "Set the given platform."         }
 ,   {'a', "arch",       "kv", nil, "Set the given architecture."     }
 ,   {'m', "mode",       "kv", nil, "Set the given mode."             }
@@ -64,8 +65,12 @@ function _require_packages(argv, packages)
     if argv.shallow then
         table.insert(require_argv, "--shallow")
     end
-    if argv.mode == "debug" then
+    if argv.mode == "debug" and argv.shared then
+        table.insert(require_argv, "--extra={debug=true,configs={shared=true}}")
+    elseif argv.mode == "debug" then
         table.insert(require_argv, "--extra={debug=true}")
+    elseif argv.shared then
+        table.insert(require_argv, "--extra={configs={shared=true}}")
     end
     table.join2(require_argv, packages)
     os.vexecv("xmake", require_argv)