-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (42 loc) · 1.73 KB
/
swift-format-check.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
name: ✅ Swift Formatting Check
# Separated from checks.yml since it takes longer to build swift-format from source
on:
push:
branches: [main]
paths:
- quill_native_bridge_ios/ios/quill_native_bridge_ios/**/*.swift
- quill_native_bridge_macos/macos/quill_native_bridge_macos/**/*.swift
- .github/workflows/swift-format-check.yml
pull_request:
paths:
- quill_native_bridge_ios/ios/quill_native_bridge_ios/**/*.swift
- quill_native_bridge_macos/macos/quill_native_bridge_macos/**/*.swift
- .github/workflows/swift-format-check.yml
jobs:
format-check:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
SWIFT_FORMAT_VERSION: 600.0.0
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 🛠️ Setup Swift
uses: swift-actions/setup-swift@v2
- name: 📦 Install Swift Format
run: |
git clone --branch $SWIFT_FORMAT_VERSION --depth 1 https://github.com/swiftlang/swift-format.git
cd swift-format
swift build -c release
sudo mv .build/release/swift-format /usr/local/bin/
- name: 🔍 Verify Swift Format installation
run: swift-format --version
- name: ℹ️ Print the default configuration
run: swift-format dump-configuration
- name: 🔎 Validate Swift Code Formatting
run: |
swift-format lint -r quill_native_bridge_ios/ios/quill_native_bridge_ios --strict
swift-format lint -r quill_native_bridge_macos/macos/quill_native_bridge_macos --strict
# SwiftLint: https://github.com/realm/SwiftLint
# - name: 🎨 Verify Swift Code Style with SwiftLint
# uses: norio-nomura/[email protected]