mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
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:
14
.github/workflows/_swift.yml
vendored
14
.github/workflows/_swift.yml
vendored
@@ -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 }}"
|
||||
|
||||
Reference in New Issue
Block a user