-
Notifications
You must be signed in to change notification settings - Fork 593
36 lines (31 loc) · 966 Bytes
/
swift.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
name: Swift Format
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
jobs:
swift-format:
name: Swift format and lint
runs-on: ubuntu-latest
container:
image: swift
volumes:
- ${{ github.workspace }}:${{ github.workspace }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# https://github.com/actions/runner/issues/2033
- name: Set safe directory
run: |
git config --global --add safe.directory /__w/ice/ice
- name: swift-format Format
working-directory: swift
run: |
swift format . --recursive --in-place --configuration .swift-format.json
git diff --exit-code
- name: swift-format Lint
working-directory: swift
run: swift format lint . --recursive --strict --configuration .swift-format.json