-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (54 loc) · 2.69 KB
/
unit-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Unit Test
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
deploy:
name: Running unit tests
runs-on: macos-14
steps:
- name: Select Xcode version
#run: sudo xcode-select -s '/Applications/Xcode_14.3.1.app/Contents/Developer'
run: sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'
- name: Checkout repository
uses: actions/[email protected]
- name: Get current date
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
# # Temporary step due to Xcode 15 / Github actions runner issues
# - name: Install iOS 16 simulator for Xcode 15
# run: |
# # Make iOS 16.4 simulator runtime available to Xcode 15
# sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
# sudo ln -s /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 16.4.simruntime
# # Create an iOS 16.4 simulator
# xcrun simctl create "iPhone 14 Pro (16.4)" "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro" "com.apple.CoreSimulator.SimRuntime.iOS-16-4"
# - name: Install yeetd
# run: |
# wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
# sudo installer -pkg yeetd-normal.pkg -target /
# yeetd &
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v3
# with:
# languages: "swift"
# - name: Launch simulator
# run: open -a Simulator --args -CurrentDeviceUDID $(xcrun simctl list --json | ruby -e "require 'json'; puts JSON.parse(ARGF.read)['devices']['com.apple.CoreSimulator.SimRuntime.iOS-17-0'].find { |s| s['name'] == 'iPhone 15' }['udid']")
- name: Test
#run: xcodebuild test -scheme KukaiCoreSwift -destination "platform=iOS Simulator,OS=16.4,name=iPhone 14" -enableCodeCoverage YES -resultBundlePath "~/xcode-$NOW.xcresult"
run: xcodebuild test -scheme KukaiCoreSwift -destination "platform=iOS Simulator,OS=17.2,name=iPhone 15" -enableCodeCoverage YES -resultBundlePath "~/xcode-$NOW.xcresult"
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v3
# with:
# category: "/language:swift"
- name: Upload results
if: ${{ success() || failure() }}
uses: actions/[email protected]
with:
name: "results-${{ env.NOW }}.xcresult"
path: "~/xcode-${{ env.NOW }}.xcresult"