Skip to content

Commit 23ea12b

Browse files
committed
ci: add path filters, concurrency, and SPM cache to CI workflow
1 parent d390f85 commit 23ea12b

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
11
name: CI
2+
23
on:
34
workflow_dispatch:
45
push:
56
branches: [main]
7+
paths:
8+
- '**/*.swift'
9+
- 'Package.swift'
10+
- 'Package.resolved'
11+
- '.github/workflows/ci.yml'
612
pull_request:
713
branches: [main]
14+
paths:
15+
- '**/*.swift'
16+
- 'Package.swift'
17+
- 'Package.resolved'
18+
- '.github/workflows/ci.yml'
19+
20+
concurrency:
21+
group: ci-${{ github.ref }}
22+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
23+
824
permissions:
925
contents: read
26+
1027
jobs:
1128
test:
1229
runs-on: macos-latest
1330
steps:
1431
- uses: actions/checkout@v4
32+
- name: Cache SPM
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
.build
37+
~/Library/Caches/org.swift.swiftpm
38+
key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
39+
restore-keys: spm-${{ runner.os }}-
1540
- run: swift test --enable-code-coverage
1641
- name: Convert coverage
1742
run: |

0 commit comments

Comments
 (0)