-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 1.16 KB
/
ci-linter-swiftlint.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
37
38
39
40
41
42
# Leka - iOS Monorepo
# Copyright 2023 APF France handicap
# SPDX-License-Identifier: Apache-2.0
name: Linter - SwiftLint
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
swift_format:
name: lint
runs-on: [self-hosted, iOS]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags
lfs: true
- name: Run swiftlint
run: |
echo ""
echo "🏃♂️ Running swiftlint on modified files 🤵♂️"
swiftlint --version
git diff --name-status origin/main \
| grep -E "^A|^M" | sed "s/^[AM]\t//g" \
| grep -E "\.swift\$$" \
|| echo "No files added nor modified!"
git diff --name-status origin/main \
| grep -E "^A|^M" | sed "s/^[AM]\t//g" \
| grep -E "\.swift\$$" \
| xargs --no-run-if-empty swiftlint lint --quiet --strict --reporter github-actions-logging