Skip to content

Commit a3f634e

Browse files
authored
Merge pull request #1090 from ahoppen/format-pilot-projects
Add GitHub workflow to ensure formatting is not broken on a set of pilot projects
2 parents 3ef9d02 + 73f827a commit a3f634e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/pull_request.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,39 @@ jobs:
2626
with:
2727
license_header_check_project_name: "Swift.org"
2828
api_breakage_check_allowlist_path: "api-breakages.txt"
29+
compatibility_check:
30+
# Format a list of real-world projects that enforce formatting using the latest swift-format version.
31+
name: Check compatibility with real world projects
32+
runs-on: ubuntu-latest
33+
container:
34+
image: swift:6.2
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
with:
39+
persist-credentials: false
40+
- name: Check out related PRs
41+
run: |
42+
apt-get update && apt-get install -y curl
43+
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift
44+
swift /tmp/cross-pr-checkout.swift "${{ github.repository }}" "${{ github.event.number }}"
45+
- name: Build
46+
run: swift build --configuration release
47+
- name: Format swift-format
48+
run: .build/release/swift-format lint --parallel --recursive --strict .
49+
- name: Checkout swift-syntax
50+
uses: actions/checkout@v4
51+
with:
52+
repository: swiftlang/swift-syntax
53+
persist-credentials: false
54+
path: swift-syntax
55+
- name: Format swift-syntax
56+
run: .build/release/swift-format lint --parallel --recursive --strict swift-syntax
57+
- name: Checkout sourcekit-lsp
58+
uses: actions/checkout@v4
59+
with:
60+
repository: swiftlang/sourcekit-lsp
61+
persist-credentials: false
62+
path: sourcekit-lsp
63+
- name: Format sourcekit-lsp
64+
run: .build/release/swift-format lint --parallel --recursive --strict sourcekit-lsp

0 commit comments

Comments
 (0)