-
-
Notifications
You must be signed in to change notification settings - Fork 29
73 lines (59 loc) · 1.88 KB
/
Copy pathlint.yml
File metadata and controls
73 lines (59 loc) · 1.88 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
name: Lint
on:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
linting:
name: Formatting and Linting
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install dependencies
run: command -v swiftlint >/dev/null 2>&1 || brew install swiftlint
- name: Install SwiftFormat
env:
SWIFTFORMAT_VERSION: 0.62.1
run: |
# Pinned rather than using the runner image's preinstalled build, so an
# image update cannot change the lint result without a commit here.
curl -sSL --fail -o /tmp/swiftformat.zip \
"https://github.com/nicklockwood/SwiftFormat/releases/download/${SWIFTFORMAT_VERSION}/swiftformat.zip"
unzip -o -q /tmp/swiftformat.zip -d /tmp/swiftformat-bin
chmod +x /tmp/swiftformat-bin/swiftformat
echo "/tmp/swiftformat-bin" >> "$GITHUB_PATH"
- name: Lint
run: swiftlint lint --strict
- name: Format
run: |
swiftformat --version
swiftformat --lint --strict .
codegen:
name: Code Generation Checks
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install dependencies
run: command -v swiftgen >/dev/null 2>&1 || brew install swiftgen
- name: Regenerate
run: swiftgen config run --config swiftgen.yml
- name: Verify no changes
run: |
if ! git diff --exit-code; then
echo "::error::Generated files are out of date. Run 'swiftgen config run --config swiftgen.yml' and commit the result."
exit 1
fi