-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (37 loc) · 997 Bytes
/
swiftformat.yml
File metadata and controls
42 lines (37 loc) · 997 Bytes
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
name: Formatting Code
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
swiftformat:
name: Swift
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Check for Swift file changes
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
swift:
- '**/*.swift'
- uses: SwiftyLab/setup-swift@latest
if: steps.changes.outputs.swift == 'true'
with:
swift-version: 6.2
- name: Cache SwiftPM artifacts
if: steps.changes.outputs.swift == 'true'
uses: actions/cache@v4
with:
path: |
~/.swiftpm
.build
key: ${{ runner.os }}-swiftpm-format-${{ hashFiles('**/Package.swift') }}
restore-keys: |
${{ runner.os }}-swiftpm-format
- name: Format code
if: steps.changes.outputs.swift == 'true'
run: Scripts/format.sh --lint . --reporter github-actions-log