Skip to content

Commit 86768fe

Browse files
committed
refactor: align CI workflow with ecosystem standards
- Add Swift version to cache keys to prevent version mismatch issues - Add Package.swift validation step - Add README verification tests step - Add API breaking changes check step - Improve cache isolation between Swift 6.0 and 6.2 builds - Align workflow structure with swift-css-types standards This ensures consistent CI validation across all type packages and prevents issues from cached modules built with different Swift versions.
1 parent 9f0d964 commit 86768fe

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,26 @@ jobs:
3131
uses: actions/cache@v4
3232
with:
3333
path: .build
34-
key: ${{ runner.os }}-spm-${{ hashFiles('Package.swift') }}
34+
key: ${{ runner.os }}-swift62-spm-${{ hashFiles('Package.swift') }}
3535
restore-keys: |
36-
${{ runner.os }}-spm-
36+
${{ runner.os }}-swift62-spm-
3737
3838
# Note: swift test builds automatically, no separate build step needed
3939
- name: Test
4040
run: swift test -c debug
4141

42+
- name: Validate Package.swift
43+
run: swift package dump-package
44+
45+
- name: Run README verification tests
46+
run: swift test --filter ReadmeVerificationTests
47+
48+
- name: Check for API breaking changes
49+
run: |
50+
swift package diagnose-api-breaking-changes \
51+
--breakage-allowlist-path .swift-api-breakage-allowlist || true
52+
continue-on-error: true
53+
4254
# Production validation: Latest Swift on Linux with release build
4355
linux-latest:
4456
name: Ubuntu (Swift 6.2, release)
@@ -51,8 +63,8 @@ jobs:
5163
uses: actions/cache@v4
5264
with:
5365
path: .build
54-
key: ${{ runner.os }}-spm-${{ hashFiles('Package.swift') }}
55-
restore-keys: ${{ runner.os }}-spm-
66+
key: ${{ runner.os }}-swift62-spm-${{ hashFiles('Package.swift') }}
67+
restore-keys: ${{ runner.os }}-swift62-spm-
5668

5769
# Note: swift test builds automatically in release mode
5870
- name: Test (release)
@@ -71,8 +83,8 @@ jobs:
7183
uses: actions/cache@v4
7284
with:
7385
path: .build
74-
key: ${{ runner.os }}-swift60-spm-${{ hashFiles('Package.swift') }}
75-
restore-keys: ${{ runner.os }}-swift60-spm-
86+
key: ${{ runner.os }}-swift60-compat-spm-${{ hashFiles('Package.swift') }}
87+
restore-keys: ${{ runner.os }}-swift60-compat-spm-
7688

7789
# Note: swift test builds automatically
7890
- name: Test (Swift 6.0)

0 commit comments

Comments
 (0)