ci: Explicitly run swiftlint (#8447)

~~Apparently `xcodebuild` doesn't bubble these up from CLI
invocations.~~

The `swiftlint` CLI binary isn't installed on the GitHub runners, so we
need to install it. This PR also explicitly runs `swiftlint` before any
build operations to display a nicer diff if files were changed as a
result of the fixing.
This commit is contained in:
Jamil
2025-03-15 22:09:56 -05:00
committed by GitHub
parent 43d084f97f
commit 0c231eb536

View File

@@ -69,6 +69,20 @@ jobs:
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-${{ hashFiles('swift/*', 'rust/**/*.rs', 'rust/**/*.toml', 'rust/**/*.lock}') }}
- name: swiftlint
run: |
# The binary is not installed by default
brew install swiftlint
cd swift/apple
swiftlint --autocorrect
swiftlint --strict
if [ ! -z "$(git status --porcelain)" ]; then
echo 'swiftlint corrected files!'
git diff
exit 1
fi
- run: ${{ matrix.build-script }}
env:
IOS_APP_PROVISIONING_PROFILE: "${{ secrets.APPLE_IOS_APP_PROVISIONING_PROFILE }}"