ruki преди 5 години
родител
ревизия
cbbb9aa892
променени са 5 файла, в които са добавени 16 реда и са изтрити 24 реда
  1. 3 5
      .github/workflows/linux.yml
  2. 3 5
      .github/workflows/macos.yml
  3. 4 6
      .github/workflows/mingw.yml
  4. 3 5
      .github/workflows/windows.yml
  5. 3 3
      scripts/test.lua

+ 3 - 5
.github/workflows/linux.yml

@@ -9,6 +9,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest]
+        kind: [static, shared]
 
     runs-on: ${{ matrix.os }}
 
@@ -18,10 +19,7 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: Tests (Static)
+      - name: Tests
         run: |
-          xmake l ./scripts/test.lua -D
+          xmake l ./scripts/test.lua -D -k ${{ matrix.kind }}
 
-      - name: Tests (Shared)
-        run: |
-          xmake l ./scripts/test.lua -D --shared

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

@@ -9,6 +9,7 @@ jobs:
     strategy:
       matrix:
         os: [macOS-latest]
+        kind: [static, shared]
 
     runs-on: ${{ matrix.os }}
 
@@ -18,10 +19,7 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: Tests (Static)
+      - name: Tests
         run: |
-          xmake l ./scripts/test.lua -D
+          xmake l ./scripts/test.lua -D -k ${{ matrix.kind }}
 
-      - name: Tests (Shared)
-        run: |
-          xmake l ./scripts/test.lua -D --shared

+ 4 - 6
.github/workflows/mingw.yml

@@ -9,6 +9,7 @@ jobs:
     strategy:
       matrix:
         os: [macOS-latest]
+        kind: [static, shared]
 
     runs-on: ${{ matrix.os }}
 
@@ -18,14 +19,11 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: prepare
+      - name: Prepare
         run: |
           brew install mingw-w64
 
-      - name: Tests (Static)
+      - name: Tests
         run: |
-          xmake l ./scripts/test.lua -D -p mingw
+          xmake l ./scripts/test.lua -D -k ${{ matrix.kind }}
 
-      - name: Tests (Shared)
-        run: |
-          xmake l ./scripts/test.lua -D -p mingw --shared

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

@@ -9,6 +9,7 @@ jobs:
     strategy:
       matrix:
         os: [windows-latest]
+        kind: [static, shared]
 
     runs-on: ${{ matrix.os }}
 
@@ -18,10 +19,7 @@ jobs:
         with:
           xmake-version: branch@dev
 
-      - name: Tests (Static)
+      - name: Tests
         run: |
-          xmake l ./scripts/test.lua -D
+          xmake l ./scripts/test.lua -D -k ${{ matrix.kind }}
 
-      - name: Tests (Shared)
-        run: |
-          xmake l ./scripts/test.lua -D --shared

+ 3 - 3
scripts/test.lua

@@ -9,7 +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."          }
+,   {'k', "kind",       "kv", nil, "Enable static/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."             }
@@ -65,11 +65,11 @@ function _require_packages(argv, packages)
     if argv.shallow then
         table.insert(require_argv, "--shallow")
     end
-    if argv.mode == "debug" and argv.shared then
+    if argv.mode == "debug" and argv.kind == "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
+    elseif argv.kind == "shared" then
         table.insert(require_argv, "--extra={configs={shared=true}}")
     end
     table.join2(require_argv, packages)