Run SwiftFormat in GH Action (#28)

This commit is contained in:
Marc Rousavy
2021-03-09 10:53:29 +01:00
committed by GitHub
parent 168ba054d1
commit 64bb6f6a2a
22 changed files with 383 additions and 234 deletions

View File

@@ -13,33 +13,30 @@ on:
- 'ios/**'
jobs:
lint:
name: SwiftLint
SwiftLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run SwiftLint GitHub Action (--strict)
uses: norio-nomura/action-swiftlint@3.2.1
uses: norio-nomura/action-swiftlint@master
with:
args: --strict
env:
# DIFF_BASE: ${{ github.base_ref }}
WORKING_DIRECTORY: ios
# TODO: Figure out how to run SwiftFormat in a GitHub action
# SwiftFormat:
# name: SwiftFormat
# description: 'https://github.com/nicklockwood/SwiftFormat'
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./ios
# steps:
# - uses: actions/checkout@v2
SwiftFormat:
runs-on: macOS-latest
defaults:
run:
working-directory: ./ios
steps:
- uses: actions/checkout@v2
# - name: Format Swift code
# run: swiftformat --verbose .
# working-directory: ${{env.working-directory}}
- name: Install SwiftFormat
run: brew install swiftformat
# - name: Verify formatted code is unchanged
# run: git diff --exit-code HEAD
# working-directory: ${{env.working-directory}}
- name: Format Swift code
run: swiftformat --verbose .
- name: Verify formatted code is unchanged
run: git diff --exit-code HEAD