Skip to content

Don't cache subelements #921

Don't cache subelements

Don't cache subelements #921

Workflow file for this run

name: Linter
on:
push:
branches:
- main
pull_request:
jobs:
lint:
name: Lint Swift code with SwiftFormat
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read env
run: cat .github/workflows/env.properties >> $GITHUB_ENV
- name: Switch to Xcode ${{ env.xcode_version }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcode_version }}.app
- name: Cache SPM build
uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Run SwiftFormat
run: |
swift run -c release swiftformat --lint .
- name: Report error
if: ${{ failure() }}
run: |
echo '::error::SwiftFormat linting failed. Run `Scripts/swiftformat` to format your code.'