-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (67 loc) · 2.48 KB
/
Copy pathci.yml
File metadata and controls
80 lines (67 loc) · 2.48 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
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
name: Format (swift-format lint)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Select latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Show toolchain
run: swift --version
# Fails (exit 1) on any formatting deviation thanks to --strict.
# The .swift-format config at the repo root is auto-discovered.
- name: Check formatting
run: |
git ls-files '*.swift' -z \
| xargs -0 swift format lint --strict --configuration .swift-format
build:
name: Build (iOS simulator)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Select latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Show toolchain
run: swift --version
# iOS-only package: build against the simulator SDK (a plain `swift build`
# would target macOS and fail on UIKit-dependent code).
- name: Build library
run: |
SDK_PATH="$(xcrun --sdk iphonesimulator --show-sdk-path)"
swift build --sdk "$SDK_PATH" --triple arm64-apple-ios16.0-simulator
# The integration tests reference TestConfig (gitignored — it holds real
# credentials). CI only compiles the tests, so write a placeholder with
# the same shape as Helpers/TestConfig.example.swift.
- name: Generate placeholder TestConfig
run: |
cat > Tests/FastCommentsUITests/Helpers/TestConfig.swift <<'SWIFT'
enum TestConfig {
static let tenantId = "ci-placeholder"
static let apiKey = "ci-placeholder"
static let e2eApiKey = "ci-placeholder"
static let host = "https://fastcomments.com"
}
SWIFT
- name: Compile tests
run: |
SDK_PATH="$(xcrun --sdk iphonesimulator --show-sdk-path)"
swift build --build-tests --sdk "$SDK_PATH" --triple arm64-apple-ios16.0-simulator
- name: Build example app
run: |
xcodebuild build \
-project ExampleApp/FastCommentsExample.xcodeproj \
-scheme FastCommentsExample \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO