Skip to content

Bump checkout and upload-artifacts #1111

Bump checkout and upload-artifacts

Bump checkout and upload-artifacts #1111

Workflow file for this run

name: Linter
on:
push:
branches:
- main
pull_request:
jobs:
lint:
name: Lint Swift code with SwiftFormat
runs-on: macos-13-xlarge
steps:
- name: Checkout
uses: actions/checkout@v4
- 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.'