2021-02-23 04:12:04 -07:00
|
|
|
name: Validate Swift
|
|
|
|
|
2021-02-23 04:16:41 -07:00
|
|
|
on: push
|
|
|
|
# push:
|
|
|
|
# branches:
|
|
|
|
# - master
|
|
|
|
# paths:
|
|
|
|
# - ".github/workflows/validate-swift.yaml"
|
|
|
|
# - "ios/"
|
|
|
|
# - "example/ios/"
|
|
|
|
# pull_request:
|
|
|
|
# paths:
|
|
|
|
# - ".github/workflows/validate-swift.yaml"
|
|
|
|
# - "ios/"
|
|
|
|
# - "example/ios/"
|
2021-02-23 04:12:04 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
SwiftLint:
|
|
|
|
name: SwiftLint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: GitHub Action for SwiftLint with --strict
|
|
|
|
uses: norio-nomura/action-swiftlint@3.2.1
|
|
|
|
with:
|
|
|
|
args: --strict
|
|
|
|
env:
|
|
|
|
# DIFF_BASE: ${{ github.base_ref }}
|
|
|
|
WORKING_DIRECTORY: ios
|
|
|
|
SwiftFormat:
|
|
|
|
name: SwiftFormat
|
2021-02-23 04:29:16 -07:00
|
|
|
description: 'https://github.com/nicklockwood/SwiftFormat'
|
|
|
|
runs:
|
|
|
|
using: 'docker'
|
|
|
|
image: 'Dockerfile'
|
2021-02-23 04:12:04 -07:00
|
|
|
env:
|
|
|
|
working-directory: ./ios
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Format Swift code
|
|
|
|
run: swiftformat --verbose .
|
|
|
|
working-directory: ${{env.working-directory}}
|
|
|
|
|
|
|
|
- name: Verify formatted code is unchanged
|
|
|
|
run: git diff --exit-code HEAD
|
|
|
|
working-directory: ${{env.working-directory}}
|