diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 055d74b..947f02a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,14 @@ jobs: - uses: SwiftyLab/setup-swift@latest with: swift-version: ${{ matrix.swift }} + - name: Cache SwiftPM build products + uses: actions/cache@v6 + with: + path: | + .build + ~/.cache/org.swift.swiftpm + ~/Library/Caches/org.swift.swiftpm + key: swiftpm-test-${{ matrix.os }}-swift${{ matrix.swift }}-${{ hashFiles('Package.resolved') }} - name: Build run: swift build -v - name: Test @@ -56,6 +64,14 @@ jobs: - uses: SwiftyLab/setup-swift@latest with: swift-version: "6.3" + - name: Cache SwiftPM build products + uses: actions/cache@v6 + with: + path: | + .build + ~/.cache/org.swift.swiftpm + ~/Library/Caches/org.swift.swiftpm + key: swiftpm-docs-macos-latest-swift6.3-${{ hashFiles('Package.resolved') }} - name: Build documentation run: | swift package \ diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index c3165ff..c0dea87 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -23,6 +23,14 @@ jobs: - uses: SwiftyLab/setup-swift@latest with: swift-version: "6.3" + - name: Cache SwiftPM build products + uses: actions/cache@v6 + with: + path: | + .build + ~/.cache/org.swift.swiftpm + ~/Library/Caches/org.swift.swiftpm + key: swiftpm-docs-macos-latest-swift6.3-${{ hashFiles('Package.resolved') }} - name: Build run: | swift package \ diff --git a/.github/workflows/periphery.yml b/.github/workflows/periphery.yml index 0a7bbba..438db5f 100644 --- a/.github/workflows/periphery.yml +++ b/.github/workflows/periphery.yml @@ -8,6 +8,17 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v6 + - name: Record Swift version + id: swift + run: echo "version=$(swift --version | head -n1 | sed 's/[^[:alnum:].]/-/g')" >> "$GITHUB_OUTPUT" + - name: Cache SwiftPM build products + uses: actions/cache@v6 + with: + path: | + .build + ~/.cache/org.swift.swiftpm + ~/Library/Caches/org.swift.swiftpm + key: swiftpm-periphery-macos-latest-${{ steps.swift.outputs.version }}-${{ hashFiles('Package.resolved') }} - name: Install Periphery run: brew install peripheryapp/periphery/periphery - name: Run Periphery