Skip to content

Commit 5e05761

Browse files
authored
Merge pull request #771 from HeroTransitions/feature/CICDFix
build.yml CI/CD update current github runner env
2 parents 45aed92 + c9a98cf commit 5e05761

File tree

2 files changed

+60
-78
lines changed

2 files changed

+60
-78
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches:
3+
branches:
44
- master
55
name: Build
66
jobs:
@@ -10,14 +10,28 @@ jobs:
1010
strategy:
1111
matrix:
1212
destination: [
13-
'platform=iOS Simulator,OS=12.4,name=iPhone X',
14-
'platform=tvOS Simulator,OS=12.4,name=Apple TV 4']
13+
'platform=Any iOS Simulator',
14+
'platform=Any tvOS Simulator',
15+
'platform=macOS,arch=x86_64',
16+
'platform=macOS,arch=arm64',
17+
'platform=macCatalyst,arch=x86_64',
18+
'platform=macCatalyst,arch=arm64',
19+
]
1520
steps:
1621
- name: Checkout
1722
uses: actions/checkout@master
1823
- name: Build
1924
run: |
2025
pod install
21-
set -o pipefail && xcodebuild clean build -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
22-
env:
23-
destination: ${{ matrix.destination }}
26+
set -o pipefail && \
27+
xcodebuild clean build \
28+
-workspace Hero.xcworkspace \
29+
-scheme Hero \
30+
-destination "${destination}" \
31+
-parallelizeTargets -showBuildTimingSummary \
32+
-enableCodeCoverage YES \
33+
CODE_SIGN_IDENTITY="" \
34+
CODE_SIGNING_REQUIRED=NO \
35+
| xcpretty
36+
env:
37+
destination: ${{ matrix.destination }}

.github/workflows/test.yml

Lines changed: 40 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,66 @@
1+
# test.yml
2+
# Unit Test
13
name: Unit Test
2-
3-
on:
4+
'on':
45
pull_request:
56
paths:
6-
- "**.swift"
7-
- "**.xcodeproj"
8-
- "**.m"
9-
- "**.h"
10-
- "**.podspec"
11-
- "Podfile"
12-
- "Podfile.lock"
13-
- "test.yml"
7+
- '**.swift'
8+
- '**.xcodeproj'
9+
- '**.m'
10+
- '**.h'
11+
- '**.podspec'
12+
- Podfile
13+
- Podfile.lock
14+
- '**/test.yml'
1415
jobs:
1516
swiftpm:
1617
name: Test iOS (swiftpm)
1718
runs-on: macOS-latest
1819
env:
19-
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
20+
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
2021
steps:
2122
- name: Checkout
2223
uses: actions/checkout@master
2324
- name: iOS - Swift PM
2425
run: |
2526
pod install
2627
set -o pipefail && swift test --parallel
27-
iOS:
28+
XCode:
2829
name: Test iOS
2930
runs-on: macOS-latest
3031
env:
31-
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
32+
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
3233
strategy:
33-
matrix:
34-
destination: [
35-
'platform=iOS Simulator,OS=14.4,name=iPhone 12'
36-
]
34+
matrix:
35+
run-config:
36+
- scheme: Hero
37+
platform: iOS
38+
action: test
39+
code-coverage: true
40+
- scheme: Hero (tvOS)
41+
platform: tvOS
42+
action: build
43+
code-coverage: false
3744
steps:
3845
- name: Checkout
3946
uses: actions/checkout@master
4047

41-
- name: iOS - ${{ matrix.destination }}
48+
- name: CocoaPods - ${{ matrix.run-config.destination }}
4249
run: |
4350
pod install
44-
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
45-
bash <(curl -s https://codecov.io/bash)
46-
env:
47-
destination: ${{ matrix.destination }}
48-
- name: Upload Code Coverage
49-
run: |
50-
bash <(curl -s https://codecov.io/bash)
51-
env:
52-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
53-
# iOS-legacy:
54-
# name: Test iOS
55-
# runs-on: macOS-latest
56-
# env:
57-
# DEVELOPER_DIR: /Applications/Xcode_10.3.1.app/Contents/Developer
58-
# strategy:
59-
# matrix:
60-
# destination: [
61-
# 'platform=iOS Simulator,OS=10.3.1,name=iPhone 7'
62-
# ]
63-
# steps:
64-
# - name: Checkout
65-
# uses: actions/checkout@master
66-
# - name: iOS - ${{ matrix.destination }}
67-
# run: |
68-
# xcversion simulators --install='iOS 10.3.1'
69-
# pod install
70-
# 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
71-
# bash <(curl -s https://codecov.io/bash)
72-
# env:
73-
# destination: ${{ matrix.destination }}
74-
# - name: Upload Code Coverage
75-
# run: |
76-
# bash <(curl -s https://codecov.io/bash)
77-
# env:
78-
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
79-
tvOS:
80-
name: Test tvOS
81-
runs-on: macOS-latest
82-
env:
83-
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
84-
strategy:
85-
matrix:
86-
destination: [
87-
'platform=tvOS Simulator,OS=14.3,name=Apple TV 4K'
88-
]
8951
90-
steps:
91-
- name: Checkout
92-
uses: actions/checkout@master
93-
- name: tvOS - ${{ matrix.destination }}
94-
run: |
95-
pod install
96-
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
97-
env:
98-
destination: ${{ matrix.destination }}
52+
- name: Test - ${{ matrix.run-config.platform }}
53+
uses: mxcl/[email protected]
54+
with:
55+
platform: ${{ matrix.run-config.platform }}
56+
action: ${{ matrix.run-config.action }}
57+
code-coverage: ${{ matrix.run-config.code-coverage }}
58+
configuration: Debug
59+
scheme: ${{ matrix.run-config.scheme }}
60+
workspace: Hero.xcworkspace
61+
62+
- name: Upload Code Coverage
63+
uses: codecov/codecov-action@v3
64+
if: ${{ matrix.run-config.code-coverage }}
65+
with:
66+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)