-
Notifications
You must be signed in to change notification settings - Fork 11
87 lines (73 loc) · 2.15 KB
/
lint.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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Lint
on:
push:
branches:
- 'feature/**'
workflow_dispatch:
inputs:
force_ktlint:
description: 'Force run ktlint'
required: false
default: false
type: boolean
force_swiftlint:
description: 'Force run SwiftLint'
required: false
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
files-changed:
name: Detect what files changed
uses: ./.github/workflows/detect_changed_files_reusable_workflow.yml
ktlint:
needs: files-changed
if: ${{ inputs.force_ktlint || needs.files-changed.outputs.android == 'true' || needs.files-changed.outputs.shared == 'true' }}
name: Run ktlint
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup CI
uses: ./.github/actions/setup-android
- name: Run ktlint
run: ./gradlew ktlintCheck --stacktrace
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
swiftlint:
needs: files-changed
if: ${{ inputs.force_swiftlint || needs.files-changed.outputs.ios == 'true' }}
name: Run SwiftLint
runs-on: macos-13
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Ruby
uses: ruby/[email protected]
with:
ruby-version: '3.1.0'
bundler-cache: true
working-directory: './iosHyperskillApp'
- name: Cache Pods
uses: actions/[email protected]
id: cache-pods
with:
path: './iosHyperskillApp/Pods'
key: ${{ runner.os }}-pods-${{ hashFiles('iosHyperskillApp/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods
if: steps.cache-pods.outputs.cache-hit != 'true'
working-directory: './iosHyperskillApp'
run: bundle exec pod install
- name: Run SwiftLint
working-directory: './iosHyperskillApp'
run: ./lint.sh