From 2f8096d167cfabd12b0ea6e0181181ac8cd6aa69 Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Sat, 20 Jan 2024 20:09:43 -0500 Subject: [PATCH 1/2] build.yml test.yml update github runner env Signed-off-by: Joseph Mattello --- .github/workflows/build.yml | 21 +++++++++++++++------ .github/workflows/test.yml | 8 ++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a2ac5d8..3fd104ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ on: push: - branches: + branches: - master name: Build jobs: @@ -10,14 +10,23 @@ jobs: strategy: matrix: destination: [ - 'platform=iOS Simulator,OS=12.4,name=iPhone X', - 'platform=tvOS Simulator,OS=12.4,name=Apple TV 4'] + 'platform=iOS Simulator,OS=16.2,name=iPhone 14', + 'platform=tvOS Simulator,OS=16.1,name=Apple TV 4'] steps: - name: Checkout uses: actions/checkout@master - name: Build run: | pod install - set -o pipefail && xcodebuild clean build -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO - env: - destination: ${{ matrix.destination }} \ No newline at end of file + set -o pipefail && \ + xcodebuild clean build \ + -workspace Hero.xcworkspace \ + -scheme Hero \ + -destination "${destination}" \ + -parallelizeTargets -showBuildTimingSummary \ + -enableCodeCoverage YES \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + | xcpretty + env: + destination: ${{ matrix.destination }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eba75f01..b034d377 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,13 +10,13 @@ on: - "**.podspec" - "Podfile" - "Podfile.lock" - - "test.yml" + - "**/test.yml" jobs: swiftpm: name: Test iOS (swiftpm) runs-on: macOS-latest env: - DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer steps: - name: Checkout uses: actions/checkout@master @@ -28,11 +28,11 @@ jobs: name: Test iOS runs-on: macOS-latest env: - DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer strategy: matrix: destination: [ - 'platform=iOS Simulator,OS=14.4,name=iPhone 12' + 'platform=iOS Simulator,iOS=16.2,name=iPhone 14' ] steps: - name: Checkout From c9a98cf7f077cdb5a4107355825ed5956185f6ce Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Fri, 26 Jan 2024 21:04:54 -0500 Subject: [PATCH 2/2] CI/CI build and test, matrix platforms fix? Signed-off-by: Joseph Mattello --- .github/workflows/build.yml | 9 ++- .github/workflows/test.yml | 108 +++++++++++++----------------------- 2 files changed, 45 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3fd104ee..3a660220 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,13 @@ jobs: strategy: matrix: destination: [ - 'platform=iOS Simulator,OS=16.2,name=iPhone 14', - 'platform=tvOS Simulator,OS=16.1,name=Apple TV 4'] + 'platform=Any iOS Simulator', + 'platform=Any tvOS Simulator', + 'platform=macOS,arch=x86_64', + 'platform=macOS,arch=arm64', + 'platform=macCatalyst,arch=x86_64', + 'platform=macCatalyst,arch=arm64', + ] steps: - name: Checkout uses: actions/checkout@master diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b034d377..0aeabec2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,17 @@ +# test.yml +# Unit Test name: Unit Test - -on: +'on': pull_request: paths: - - "**.swift" - - "**.xcodeproj" - - "**.m" - - "**.h" - - "**.podspec" - - "Podfile" - - "Podfile.lock" - - "**/test.yml" + - '**.swift' + - '**.xcodeproj' + - '**.m' + - '**.h' + - '**.podspec' + - Podfile + - Podfile.lock + - '**/test.yml' jobs: swiftpm: name: Test iOS (swiftpm) @@ -24,75 +25,42 @@ jobs: run: | pod install set -o pipefail && swift test --parallel - iOS: + XCode: name: Test iOS runs-on: macOS-latest env: DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer strategy: - matrix: - destination: [ - 'platform=iOS Simulator,iOS=16.2,name=iPhone 14' - ] + matrix: + run-config: + - scheme: Hero + platform: iOS + action: test + code-coverage: true + - scheme: Hero (tvOS) + platform: tvOS + action: build + code-coverage: false steps: - name: Checkout uses: actions/checkout@master - - name: iOS - ${{ matrix.destination }} + - name: CocoaPods - ${{ matrix.run-config.destination }} run: | pod install - set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -configuration "Debug" -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | xcpretty - bash <(curl -s https://codecov.io/bash) - env: - destination: ${{ matrix.destination }} - - name: Upload Code Coverage - run: | - bash <(curl -s https://codecov.io/bash) - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - # iOS-legacy: - # name: Test iOS - # runs-on: macOS-latest - # env: - # DEVELOPER_DIR: /Applications/Xcode_10.3.1.app/Contents/Developer - # strategy: - # matrix: - # destination: [ - # 'platform=iOS Simulator,OS=10.3.1,name=iPhone 7' - # ] - # steps: - # - name: Checkout - # uses: actions/checkout@master - # - name: iOS - ${{ matrix.destination }} - # run: | - # xcversion simulators --install='iOS 10.3.1' - # pod install - # set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty - # bash <(curl -s https://codecov.io/bash) - # env: - # destination: ${{ matrix.destination }} - # - name: Upload Code Coverage - # run: | - # bash <(curl -s https://codecov.io/bash) - # env: - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - tvOS: - name: Test tvOS - runs-on: macOS-latest - env: - DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer - strategy: - matrix: - destination: [ - 'platform=tvOS Simulator,OS=14.3,name=Apple TV 4K' - ] - steps: - - name: Checkout - uses: actions/checkout@master - - name: tvOS - ${{ matrix.destination }} - run: | - pod install - set -o pipefail && xcodebuild clean build -workspace Hero.xcworkspace -scheme "Hero (tvOS)" -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | xcpretty - env: - destination: ${{ matrix.destination }} + - name: Test - ${{ matrix.run-config.platform }} + uses: mxcl/xcodebuild@v2.0 + with: + platform: ${{ matrix.run-config.platform }} + action: ${{ matrix.run-config.action }} + code-coverage: ${{ matrix.run-config.code-coverage }} + configuration: Debug + scheme: ${{ matrix.run-config.scheme }} + workspace: Hero.xcworkspace + + - name: Upload Code Coverage + uses: codecov/codecov-action@v3 + if: ${{ matrix.run-config.code-coverage }} + with: + token: ${{ secrets.CODECOV_TOKEN }}