Add swift-format #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| name: Build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-14, macos-latest] | |
| swift: ["6.0"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: SwiftyLab/setup-swift@latest | |
| with: | |
| swift-version: ${{ matrix.swift }} | |
| - name: Build | |
| run: swift build -v | |
| lint: | |
| name: Run Swiftlint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: norio-nomura/action-swiftlint@3.2.1 | |
| swift-format: | |
| name: Run swift-format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: SwiftyLab/setup-swift@latest | |
| with: | |
| swift-version: "6.0" | |
| - name: Download .swift-format | |
| run: | | |
| curl -o .swift-format https://gist.githubusercontent.com/RISCfuture/e0c21afb7bd80a88d128a42bf40d2ecd/raw/7c4af5558f34e9deefc70701f7f7e289d0934187/.swift-format | |
| - name: Install swift-format | |
| run: | | |
| git clone https://github.com/apple/swift-format.git | |
| cd swift-format | |
| swift build -c release | |
| sudo cp .build/release/swift-format /usr/local/bin/ | |
| - name: Run swift-format lint | |
| run: swift-format lint -r . |