浏览代码

To save some CI resources

onevcat 1 年之前
父节点
当前提交
cbef318638
共有 3 个文件被更改,包括 35 次插入4 次删除
  1. 2 4
      .github/workflows/build.yaml
  2. 29 0
      .github/workflows/test.yaml
  3. 4 0
      fastlane/Fastfile

+ 2 - 4
.github/workflows/build.yaml

@@ -17,15 +17,13 @@ jobs:
         xcode: [
           '15.2',
           '15.3',
-          '15.4',
-          '16.0',
         ]
     steps:
       - uses: actions/checkout@v4
       - name: Install Gems
         run: bundle install
-      - name: Run tests
+      - name: Build framework
         env:
           DESTINATION: platform=${{ matrix.destination }}
           XCODE_VERSION: ${{ matrix.xcode }}
-        run: bundle exec fastlane test_ci
+        run: bundle exec fastlane build_ci

+ 29 - 0
.github/workflows/test.yaml

@@ -0,0 +1,29 @@
+name: test
+
+on: [push, pull_request]
+
+jobs:
+  run-test:
+    runs-on: self-hosted
+    continue-on-error: true
+    strategy:
+      matrix:
+        destination: [
+          'macOS', 
+          'iOS Simulator,name=iPhone 15', 
+          'tvOS Simulator,name=Apple TV', 
+          'watchOS Simulator,name=Apple Watch Series 9 (41mm)'
+        ]
+        xcode: [
+          '15.4',
+          '16.0',
+        ]
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install Gems
+        run: bundle install
+      - name: Run tests
+        env:
+          DESTINATION: platform=${{ matrix.destination }}
+          XCODE_VERSION: ${{ matrix.xcode }}
+        run: bundle exec fastlane test_ci

+ 4 - 0
fastlane/Fastfile

@@ -20,6 +20,10 @@ platform :ios do
     end
   end
 
+  lane :build_ci do
+    build(destination: ENV["DESTINATION"])
+  end
+
   lane :test do |options|
     scan(
       scheme: "Kingfisher",