-
Notifications
You must be signed in to change notification settings - Fork 53
116 lines (101 loc) · 4.04 KB
/
Copy pathci.yml
File metadata and controls
116 lines (101 loc) · 4.04 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: ci
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
DERIVED_DATA: ${{ github.workspace }}/.derived-data
jobs:
tests:
runs-on: macos-26
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Fetch main
run: git fetch --no-tags --depth=1 origin main
# Package checkouts and the core framework's intermediates survive
# between runs, so the test-time xcodebuild is incremental.
- name: Restore core build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .derived-data
key: core-debug-${{ runner.os }}-${{ hashFiles('wBlock.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved', 'wBlockCoreService/**', 'wBlock.xcodeproj/project.pbxproj') }}
restore-keys: |
core-debug-${{ runner.os }}-
- name: Run regression tests
env:
WBLOCK_DERIVED_DATA: ${{ env.DERIVED_DATA }}
run: scripts/run-ci-tests.sh
rules-viewer-ui:
runs-on: macos-26
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install XcodeGen
run: command -v xcodegen >/dev/null || brew install xcodegen
- name: Select an available iPhone simulator
id: simulator
run: |
xcrun simctl list devices available --json > "$RUNNER_TEMP/simulators.json"
python3 - "$RUNNER_TEMP/simulators.json" >> "$GITHUB_OUTPUT" <<'PY'
import json
import re
import sys
with open(sys.argv[1]) as source:
runtimes = json.load(source)["devices"]
versions = [(tuple(map(int, match.groups())), devices)
for runtime, devices in runtimes.items()
if (match := re.search(r"\.iOS-(\d+)-(\d+)", runtime))]
phones = [device for version, devices in sorted(versions, key=lambda item: item[0], reverse=True)
if version >= (26, 0) for device in devices
if device.get("isAvailable") and device["name"].startswith("iPhone")]
if not phones:
raise SystemExit("No available iOS 26+ iPhone simulator for the rules-viewer test host")
print("udid=" + phones[0]["udid"])
PY
- name: Run production rules-viewer gesture tests
env:
SIMULATOR: ${{ steps.simulator.outputs.udid }}
run: bash scripts/test_rules_viewer_ui.sh "$SIMULATOR"
build:
runs-on: macos-26
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: macOS
destination: generic/platform=macOS
- name: iOS Simulator
destination: generic/platform=iOS Simulator
name: build (${{ matrix.name }})
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Restore build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .derived-data
key: app-release-${{ matrix.name }}-${{ hashFiles('wBlock.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved', 'wBlock.xcodeproj/project.pbxproj') }}-${{ github.sha }}
restore-keys: |
app-release-${{ matrix.name }}-${{ hashFiles('wBlock.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved', 'wBlock.xcodeproj/project.pbxproj') }}-
app-release-${{ matrix.name }}-
- name: Build Release
run: |
set -o pipefail
xcodebuild \
-project wBlock.xcodeproj \
-scheme wBlock \
-configuration Release \
-destination '${{ matrix.destination }}' \
-derivedDataPath "$DERIVED_DATA" \
CODE_SIGNING_ALLOWED=NO \
build