-
Notifications
You must be signed in to change notification settings - Fork 17
81 lines (71 loc) · 2.61 KB
/
swiftpm.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
name: SwiftPM Build
env:
REALM_CI: true
REALM_DISABLE_ANALYTICS: true
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: macos-13
name: ${{ matrix.platform }} ${{ matrix.configuration }}, Xcode ${{ matrix.xcode }}
strategy:
fail-fast: false
max-parallel: 6
matrix:
platform:
- macOS
- macOS,variant=Mac Catalyst
- iOS
- iOS Simulator
- tvOS
- tvOS Simulator
xcode:
- '15.0'
configuration:
- Debug
- Release
exclude:
- configuration: ${{ github.event_name == 'pull_request' && 'Debug' || 'none' }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# git-restore-mtime-bare uses the ref log to find the correct timestamp
# for each file. This requires a full git history. The default value (1)
# creates a shallow checkout.
fetch-depth: 0
submodules: 'recursive'
# Restore timestamps so that DerivedData caching can work across runs
- name: Restore timestamps
uses: chetan/git-restore-mtime-action@v1
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- uses: ammaraskar/gcc-problem-matcher@master
- name: Compute cache key
id: platform-escaped
shell: pwsh
run: echo "::set-output name=value::$([uri]::EscapeDataString('${{ matrix.platform }}'))"
- name: Cache Derived Data
uses: actions/cache@v2
with:
path: .build/derivedData
key: swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache-${{ github.sha }}
restore-keys: |
swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache-
# https://stackoverflow.com/questions/53753511/is-it-possible-to-copy-an-xcode-derived-data-cache
- name: Avoid inode changes for DerivedData
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Build
run: |
scheme=realm-tests
xcodebuild -scheme $scheme -destination "generic/platform=${{ matrix.platform }}" -configuration ${{ matrix.configuration }} -derivedDataPath .build/derivedData
- name: Open a tmate debug session
if: ${{ failure() && runner.debug }}
uses: mxschmitt/action-tmate@v3
with:
timeout-minutes: 15