Skip to content

test: Use XCTestExpectation for delay non blocking #1365

test: Use XCTestExpectation for delay non blocking

test: Use XCTestExpectation for delay non blocking #1365

name: Lint Swift
on:
push:
branches:
- main
paths:
- "**/*.swift"
- ".github/workflows/lint-swift-formatting.yml"
- ".swiftlint.yml"
- "Makefile" # Make commands used for formatting setup
- "Brewfile*" # Tools installation affects formatting environment
pull_request:
paths:
- "**/*.swift"
- ".github/workflows/lint-swift-formatting.yml"
- ".swiftlint.yml"
- "Makefile" # Make commands used for formatting setup
- "Brewfile*" # Tools installation affects formatting environment
# Concurrency configuration:
# - We use workflow-specific concurrency groups to prevent multiple lint runs on the same code,
# as linting checks are deterministic and don't require parallel validation.
# - For pull requests, we cancel in-progress runs when new commits are pushed since only the latest
# linting matters for merge decisions.
# - For main branch pushes, we never cancel formatting checks to ensure our code maintains consistent
# style standards across the entire project.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
name: Lint
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Install tooling
run: make init-ci-format
- name: Run SwiftLint
run: make format-swift-all
- name: Check for Formatting Changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "❌ Some Swift code is not formatted correctly. Please run 'make format' and commit the changes."
git status
git diff
exit 1
else
echo "✅ All code is formatted correctly."
fi