Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.yml CI/CD update current github runner env #771

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
branches:
branches:
- master
name: Build
jobs:
Expand All @@ -10,14 +10,28 @@ jobs:
strategy:
matrix:
destination: [
'platform=iOS Simulator,OS=12.4,name=iPhone X',
'platform=tvOS Simulator,OS=12.4,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
- 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 }}
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 }}
112 changes: 40 additions & 72 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,66 @@
# 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)
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
- name: iOS - Swift PM
run: |
pod install
set -o pipefail && swift test --parallel
iOS:
XCode:
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'
]
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 }}
Loading