Skip to content

Commit c41e1fc

Browse files
authored
Add Format workflow (#49)
1 parent 13ee3dd commit c41e1fc

File tree

4 files changed

+50
-17
lines changed

4 files changed

+50
-17
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- cron: '3 3 * * 2' # 3:03 AM, every Tuesday
1212

1313
concurrency:
14-
group: ${{ github.ref }}
14+
group: ci-${{ github.ref }}
1515
cancel-in-progress: true
1616

1717
jobs:
@@ -32,19 +32,19 @@ jobs:
3232
- 5.6
3333
- 5.7
3434
steps:
35-
- uses: actions/checkout@v2
36-
- name: Test NavigationTransitions
37-
uses: mxcl/xcodebuild@v1
38-
with:
39-
platform: ${{ matrix.platform }}
40-
swift: ~${{ matrix.swift }}
41-
action: test
42-
scheme: NavigationTransitions
43-
- if: ${{ matrix.swift >= 5.7 }}
44-
name: Build Demo
45-
uses: mxcl/xcodebuild@v1
46-
with:
47-
platform: ${{ matrix.platform }}
48-
swift: ~${{ matrix.swift }}
49-
action: build
50-
scheme: Demo
35+
- uses: actions/checkout@v2
36+
- name: Test NavigationTransitions
37+
uses: mxcl/xcodebuild@v1
38+
with:
39+
platform: ${{ matrix.platform }}
40+
swift: ~${{ matrix.swift }}
41+
action: test
42+
scheme: NavigationTransitions
43+
- if: ${{ matrix.swift >= 5.7 }}
44+
name: Build Demo
45+
uses: mxcl/xcodebuild@v1
46+
with:
47+
platform: ${{ matrix.platform }}
48+
swift: ~${{ matrix.swift }}
49+
action: build
50+
scheme: Demo

.github/workflows/format.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: format-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
format:
14+
name: swiftformat
15+
runs-on: macos-12
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Format
19+
run: swiftformat
20+
- uses: stefanzweifel/git-auto-commit-action@v4
21+
with:
22+
commit_message: Run SwiftFormat
23+
branch: main
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.5

.swiftformat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--exclude **/RuntimeWarnings.swift
2+
--disable redundantNilInit,redundantSelf,redundantType,unusedArguments
3+
4+
--header strip
5+
--ifdef no-indent
6+
--extensionacl on-declarations
7+
--patternlet inline

0 commit comments

Comments
 (0)