Skip to content

Fix ktlint

Fix ktlint #1702

Workflow file for this run

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