Skip to content

Commit

Permalink
ci: cache swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
lovetodream authored Apr 22, 2024
1 parent e073b7c commit a397795
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a397795

Please sign in to comment.