From 433cd5c17aa8e6dc375ee4f9e20061b818afb8f8 Mon Sep 17 00:00:00 2001 From: Joe Newton <> Date: Wed, 25 Nov 2020 12:03:29 -0500 Subject: [PATCH 1/3] Updated GitHub Actions --- .github/workflows/cocoapods.yml | 3 +- .github/workflows/swift-pacakge.yml | 11 +++++++ .github/workflows/xcodebuild.yml | 48 ++++++++++++++++++++++++----- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cocoapods.yml b/.github/workflows/cocoapods.yml index d4ea8ba..2f83ae9 100644 --- a/.github/workflows/cocoapods.yml +++ b/.github/workflows/cocoapods.yml @@ -2,7 +2,8 @@ name: Cocoapods on: [pull_request, push] jobs: - build: + lint: + name: Lint runs-on: macOS-latest steps: - name: Checkout Code diff --git a/.github/workflows/swift-pacakge.yml b/.github/workflows/swift-pacakge.yml index e54e754..1d609d6 100644 --- a/.github/workflows/swift-pacakge.yml +++ b/.github/workflows/swift-pacakge.yml @@ -3,7 +3,9 @@ on: [pull_request, push] jobs: build: + name: Build runs-on: macOS-latest + steps: - name: Checkout Code uses: actions/checkout@v2 @@ -13,6 +15,15 @@ jobs: swift --version swift build -v + test: + name: Test + runs-on: macOS-latest + needs: build + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Test run: | swift test -v --enable-code-coverage diff --git a/.github/workflows/xcodebuild.yml b/.github/workflows/xcodebuild.yml index db729e9..74b4dee 100644 --- a/.github/workflows/xcodebuild.yml +++ b/.github/workflows/xcodebuild.yml @@ -2,8 +2,10 @@ name: Build Xcode Project on: [pull_request, push] jobs: - build: + ios: + name: iOS runs-on: macOS-latest + steps: - name: Checkout Code uses: actions/checkout@v2 @@ -16,26 +18,50 @@ jobs: run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug ONLY_ACTIVE_ARCH=YES - - name: Test iOS Simulator + - name: Test run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max" -configuration Debug ONLY_ACTIVE_ARCH=YES test - - name: Build Mac Catalyst + maccatalyst: + name: Mac Catalyst + runs-on: macOS-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Build run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug ONLY_ACTIVE_ARCH=YES - - name: Test Mac Catalyst + - name: Test run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES test - - name: Build macOS + macos: + name: macOS + runs-on: macOS-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Build run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES - - name: Test macOS + - name: Test run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES test + tvos: + name: tvOS + runs-on: macOS-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Build tvOS run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug ONLY_ACTIVE_ARCH=YES @@ -44,10 +70,18 @@ jobs: run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug ONLY_ACTIVE_ARCH=YES - - name: Test tvOS Simulator + - name: Test run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "platform=tvOS Simulator,name=Apple TV 4K" -configuration Debug ONLY_ACTIVE_ARCH=YES test + watchos: + name: watchOS + runs-on: macOS-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Build watchOS run: | xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -sdk watchos -configuration Debug From 48a548a5fc2433d9ee14ce6b17e3a20ee7993e1e Mon Sep 17 00:00:00 2001 From: Joe Newton <> Date: Wed, 25 Nov 2020 13:47:45 -0500 Subject: [PATCH 2/3] Updated GitHub actions to only run for pushes --- .github/workflows/cocoapods.yml | 2 +- .github/workflows/swift-pacakge.yml | 2 +- .github/workflows/xcodebuild.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cocoapods.yml b/.github/workflows/cocoapods.yml index 2f83ae9..c92af65 100644 --- a/.github/workflows/cocoapods.yml +++ b/.github/workflows/cocoapods.yml @@ -1,5 +1,5 @@ name: Cocoapods -on: [pull_request, push] +on: push jobs: lint: diff --git a/.github/workflows/swift-pacakge.yml b/.github/workflows/swift-pacakge.yml index 1d609d6..e2410ac 100644 --- a/.github/workflows/swift-pacakge.yml +++ b/.github/workflows/swift-pacakge.yml @@ -1,5 +1,5 @@ name: Build Swift Package -on: [pull_request, push] +on: push jobs: build: diff --git a/.github/workflows/xcodebuild.yml b/.github/workflows/xcodebuild.yml index 74b4dee..5f7b0e9 100644 --- a/.github/workflows/xcodebuild.yml +++ b/.github/workflows/xcodebuild.yml @@ -1,5 +1,5 @@ name: Build Xcode Project -on: [pull_request, push] +on: push jobs: ios: From fb7046978ff657b7034a43bb21f43198bf46b499 Mon Sep 17 00:00:00 2001 From: Joe Newton <> Date: Wed, 25 Nov 2020 13:48:25 -0500 Subject: [PATCH 3/3] Updated Swift Package GitHub Action to only upload code coverage from builds against the main branch --- .github/workflows/swift-pacakge.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/swift-pacakge.yml b/.github/workflows/swift-pacakge.yml index e2410ac..5b81c39 100644 --- a/.github/workflows/swift-pacakge.yml +++ b/.github/workflows/swift-pacakge.yml @@ -29,10 +29,12 @@ jobs: swift test -v --enable-code-coverage - name: Generate Code Coverage File + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} run: | xcrun llvm-cov export --instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/ProtocolProxyPackageTests.xctest/Contents/MacOS/ProtocolProxyPackageTests > ./info.lcov - name: Upload Code Coverage + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }}