diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f80b9b..4a47b82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,18 +19,27 @@ jobs: - uses: actions/checkout@v4 - name: Mark repo safe in non-fake global config run: git config --global --add safe.directory "${GITHUB_WORKSPACE}" - - name: Setup swift-format + - name: Clone swift-format run: | cd .. VERSION=510.1.0 git clone https://github.com/apple/swift-format.git cd swift-format git checkout "tags/$VERSION" + cd "${GITHUB_WORKSPACE}" + - name: Cache swift-format + uses: actions/cache@v4 + with: + path: .build + key: ${{ runner.os }}-ci-spm-${{ hashFiles('../swift-format/Package.swift') }} + restore-keys: ${{ runner.os }}-ci-spm- + - name: Setup swift-format + run: | + cd ../swift-format swift build -c release + export SWIFTFORMAT_BIN=$(pwd)/.build/release/swift-format" cd "${GITHUB_WORKSPACE}" - name: Run soundness - env: - SWIFTFORMAT_BIN: "${GITHUB_WORKSPACE}/../swift-format/.build/release/swift-format" run: | scripts/soundness.sh exit $(git status --porcelain | wc -l)