Răsfoiți Sursa

Update and cleanup github actions workflows

Florian Friedrich 4 ani în urmă
părinte
comite
81857effea

+ 3 - 1
.github/workflows/demo-builds.yml

@@ -40,8 +40,10 @@ jobs:
           - UniversalApp
           - WebServerIPhone
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - uses: sersoft-gmbh/xcodebuild-action@v1
         with:
           workspace: Demos/Demos.xcworkspace

+ 6 - 2
.github/workflows/integration-tests.yml

@@ -14,8 +14,10 @@ jobs:
   static-lib:
     runs-on: macos-latest
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - uses: sersoft-gmbh/xcodebuild-action@v1
         with:
           project: Integration/Integration.xcodeproj
@@ -36,8 +38,10 @@ jobs:
           - scheme: watchOSSwiftIntegration
             destination: 'platform=iOS Simulator,name=iPhone 11 Pro'
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - uses: sersoft-gmbh/xcodebuild-action@v1
         with:
           project: Integration/Integration.xcodeproj

+ 6 - 2
.github/workflows/library-builds.yml

@@ -17,8 +17,10 @@ jobs:
       matrix:
         sdk: [iphonesimulator, macosx]
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - uses: sersoft-gmbh/xcodebuild-action@v1
         with:
           workspace: Xcode/Lumberjack.xcworkspace
@@ -34,8 +36,10 @@ jobs:
         scheme: [CocoaLumberjack, CocoaLumberjackSwift]
         sdk: [iphonesimulator, macosx, watchsimulator, appletvsimulator]
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - uses: sersoft-gmbh/xcodebuild-action@v1
         with:
           workspace: Xcode/Lumberjack.xcworkspace

+ 22 - 9
.github/workflows/unit-tests.yml

@@ -14,16 +14,20 @@ jobs:
   swiftpm:
     runs-on: macos-latest
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - name: Run SwiftPM Tests
         run: swift test --enable-code-coverage --parallel
-      - name: Generate Coverage Files
-        run: xcrun llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest/Contents/MacOS/*PackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
-      - uses: codecov/codecov-action@v1
+      - uses: sersoft-gmbh/swift-coverage-action@v2
+        id: coverage-files
+        with:
+          format: lcov
+      - uses: codecov/codecov-action@v2.1.0
         with:
-          file: coverage.lcov
           token: ${{secrets.CODECOV_TOKEN}}
+          files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
 
   xcode:
     runs-on: macos-latest
@@ -32,26 +36,35 @@ jobs:
         scheme: [Swift Tests]
         destination:
           - platform=macOS
-          - platform=iOS Simulator,OS=latest,name=iPhone 11 Pro
+          - platform=iOS Simulator,OS=latest,name=iPhone 12 Pro
         skip-testing: ['']
         include:
           - scheme: iOS Tests
-            destination: 'platform=iOS Simulator,name=iPhone 11 Pro,OS=latest'
+            destination: 'platform=iOS Simulator,name=iPhone 12 Pro,OS=latest'
             skip-testing: 'iOS Tests/DDFileLoggerPerformanceTests'
           - scheme: OS X Tests
             destination: 'platform=macosx'
             skip-testing: 'OS X Tests/DDFileLoggerPerformanceTests'
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - uses: sersoft-gmbh/xcodebuild-action@v1
         with:
           project: Tests/Tests.xcodeproj
           scheme: ${{matrix.scheme}}
           destination: ${{matrix.destination}}
           skip-testing: ${{matrix.skip-testing}}
+          enable-code-coverage: true
+          parallel-testing-enabled: true
           build-settings: GCC_GENERATE_TEST_COVERAGE_FILES=YES
           action: test
-      - uses: codecov/codecov-action@v1
+      - uses: sersoft-gmbh/swift-coverage-action@v2
+        id: coverage-files
+        with:
+          format: lcov
+      - uses: codecov/codecov-action@v2.1.0
         with:
           token: ${{secrets.CODECOV_TOKEN}}
+          files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}

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

@@ -17,8 +17,10 @@ jobs:
     runs-on: macos-latest
     if: github.event_name != 'issue_comment'
     steps:
+      - uses: maxim-lobanov/setup-xcode@v1.3.0
+        with:
+          xcode-version: ^12.5
       - uses: actions/checkout@v2
-      - run: ./Scripts/ci-select-xcode.sh
       - run: pod lib lint
 
   run-danger-for-internal-pr:
@@ -45,11 +47,11 @@ jobs:
           required-permission: write
           reaction-permitted: '+1'
           comment-not-permitted: "Sorry, you don't have enough permission to execute /run_checks..."
-      - uses: actions/github-script@v2
+      - uses: actions/github-script@v5
         id: pr-details
         with:
           script: |
-            const { data: pullRequest } = await github.pulls.get({
+            const { data: pullRequest } = await github.rest.pulls.get({
               owner: context.repo.owner,
               repo: context.repo.repo,
               pull_number: context.issue.number

+ 0 - 3
Scripts/ci-select-xcode.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-sudo xcode-select -s /Applications/Xcode_11.5.app/Contents/Developer