2021-02-23 04:12:04 -07:00
|
|
|
name: Validate Swift
|
|
|
|
|
2021-02-23 04:38:59 -07:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-02-23 06:00:32 -07:00
|
|
|
- main
|
2021-02-23 04:38:59 -07:00
|
|
|
paths:
|
2021-02-23 04:41:31 -07:00
|
|
|
- '.github/workflows/validate-swift.yml'
|
|
|
|
- 'ios/**'
|
2021-02-23 04:38:59 -07:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2021-02-23 04:41:31 -07:00
|
|
|
- '.github/workflows/validate-swift.yml'
|
|
|
|
- 'ios/**'
|
2021-02-23 04:12:04 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
SwiftLint:
|
|
|
|
name: SwiftLint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-02-23 05:59:42 -07:00
|
|
|
- name: Run SwiftLint GitHub Action (--strict)
|
2021-02-23 04:12:04 -07:00
|
|
|
uses: norio-nomura/action-swiftlint@3.2.1
|
|
|
|
with:
|
|
|
|
args: --strict
|
|
|
|
env:
|
|
|
|
# DIFF_BASE: ${{ github.base_ref }}
|
|
|
|
WORKING_DIRECTORY: ios
|
2021-02-23 04:38:59 -07:00
|
|
|
# TODO: Figure out how to run SwiftFormat in a GitHub action
|
|
|
|
# SwiftFormat:
|
|
|
|
# name: SwiftFormat
|
|
|
|
# description: 'https://github.com/nicklockwood/SwiftFormat'
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# env:
|
|
|
|
# working-directory: ./ios
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
2021-02-23 04:12:04 -07:00
|
|
|
|
2021-02-23 04:38:59 -07:00
|
|
|
# - name: Format Swift code
|
|
|
|
# run: swiftformat --verbose .
|
|
|
|
# working-directory: ${{env.working-directory}}
|
2021-02-23 04:12:04 -07:00
|
|
|
|
2021-02-23 04:38:59 -07:00
|
|
|
# - name: Verify formatted code is unchanged
|
|
|
|
# run: git diff --exit-code HEAD
|
|
|
|
# working-directory: ${{env.working-directory}}
|