From 7ab010537ac22ad859493b8fadc44e4bc6c7ed30 Mon Sep 17 00:00:00 2001 From: Roman Lavrov Date: Tue, 4 Nov 2025 15:01:20 -0500 Subject: [PATCH 1/5] test --- .github/workflows/build.yml | 16 +++++++++++----- .github/workflows/validate_pr.yml | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/validate_pr.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 810e95d1d..c78031ec8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,12 +79,18 @@ jobs: runs-on: windows-latest name: windows (${{ matrix.tag }}) steps: - - uses: compnerd/gha-setup-swift@main + - name: Setup Swift + uses: compnerd/gha-setup-swift@main with: - tag: ${{ matrix.tag }} - branch: ${{ matrix.branch }} - - uses: actions/checkout@v4 - - run: swift test + swift-version: development + swift-build: DEVELOPMENT-SNAPSHOT-2025-08-27-a + update-sdk-modules: true + + - uses: actions/checkout@v5 + - run: | + $ExperimentalSDK = "$(Split-Path -Path ${env:SDKROOT} -Parent)/WindowsExperimental.sdk" + swift build --triple x86_64-unknown-windows-msvc -debug-info-format none -c release -Xswiftc -sdk -Xswiftc ${ExperimentalSDK} -Xswiftc -static-stdlib + swift test command-line-tool: strategy: diff --git a/.github/workflows/validate_pr.yml b/.github/workflows/validate_pr.yml new file mode 100644 index 000000000..6503e66af --- /dev/null +++ b/.github/workflows/validate_pr.yml @@ -0,0 +1,16 @@ +name: "validate" + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + check-pr-base: + name: "Pull request base is 'main'" + runs-on: ubuntu-latest + steps: + - name: Fail if PR base is not 'main' + if: github.event.pull_request.base.ref != 'main' + run: | + echo "❌ Pull request must target the 'main' branch. Current base: '${{ github.event.pull_request.base.ref }}'" + exit 1 From 5db5c1b888e3ed838ddcd4af2a24420845ff18f1 Mon Sep 17 00:00:00 2001 From: Roman Lavrov Date: Tue, 4 Nov 2025 15:45:21 -0500 Subject: [PATCH 2/5] upload exe --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c78031ec8..d946fcbd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: pull_request: jobs: macos: + if: false strategy: fail-fast: false matrix: @@ -42,6 +43,7 @@ jobs: env_vars: MD_APPLE_SDK_ROOT,RUNNER_OS,RUNNER_ARCH linux: + if: false strategy: fail-fast: false matrix: @@ -92,7 +94,15 @@ jobs: swift build --triple x86_64-unknown-windows-msvc -debug-info-format none -c release -Xswiftc -sdk -Xswiftc ${ExperimentalSDK} -Xswiftc -static-stdlib swift test + - name: 'Upload EXE' + uses: actions/upload-artifact@v4 + with: + name: swiftformat.exe + path: .build/x86_64-unknown-windows-msvc/release/swiftformat.exe + retention-days: 1 + command-line-tool: + if: false strategy: fail-fast: false matrix: @@ -112,6 +122,7 @@ jobs: run: xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Command Line Tool)" -sdk macosx clean build swiftformat-for-xcode: + if: false strategy: fail-fast: false matrix: @@ -131,6 +142,7 @@ jobs: run: xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat for Xcode" -sdk macosx clean build editor-extension: + if: false strategy: fail-fast: false matrix: @@ -148,3 +160,23 @@ jobs: uses: actions/checkout@v4 - name: Build Editor Extension run: xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Editor Extension)" -sdk macosx clean build + + regression-tests: + if: false + strategy: + fail-fast: false + matrix: + macos: + - 15 + xcode: + - 16.3 + runs-on: macos-${{ matrix.macos }} + steps: + - name: Select Xcode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode }} + - name: Checkout + uses: actions/checkout@v5 + - name: Run Regression Tests + run: xcodebuild -project SwiftFormat.xcodeproj -scheme "Regression Tests" test From be80eac2c81987e73d914b9f5e87563705c421f7 Mon Sep 17 00:00:00 2001 From: Roman Lavrov Date: Tue, 4 Nov 2025 18:09:54 -0500 Subject: [PATCH 3/5] rebased to 0.56 --- .github/workflows/build.yml | 20 -------------------- .github/workflows/validate_pr.yml | 16 ---------------- 2 files changed, 36 deletions(-) delete mode 100644 .github/workflows/validate_pr.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d946fcbd5..de6b3d9f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,23 +160,3 @@ jobs: uses: actions/checkout@v4 - name: Build Editor Extension run: xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Editor Extension)" -sdk macosx clean build - - regression-tests: - if: false - strategy: - fail-fast: false - matrix: - macos: - - 15 - xcode: - - 16.3 - runs-on: macos-${{ matrix.macos }} - steps: - - name: Select Xcode version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: ${{ matrix.xcode }} - - name: Checkout - uses: actions/checkout@v5 - - name: Run Regression Tests - run: xcodebuild -project SwiftFormat.xcodeproj -scheme "Regression Tests" test diff --git a/.github/workflows/validate_pr.yml b/.github/workflows/validate_pr.yml deleted file mode 100644 index 6503e66af..000000000 --- a/.github/workflows/validate_pr.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "validate" - -on: - pull_request: - types: [opened, edited, synchronize, reopened] - -jobs: - check-pr-base: - name: "Pull request base is 'main'" - runs-on: ubuntu-latest - steps: - - name: Fail if PR base is not 'main' - if: github.event.pull_request.base.ref != 'main' - run: | - echo "❌ Pull request must target the 'main' branch. Current base: '${{ github.event.pull_request.base.ref }}'" - exit 1 From bf565dc4896b23008a74e598107996dbaac1284d Mon Sep 17 00:00:00 2001 From: Roman Lavrov Date: Wed, 5 Nov 2025 11:07:56 -0500 Subject: [PATCH 4/5] test with flags --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de6b3d9f2..bc9e855ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,8 +91,7 @@ jobs: - uses: actions/checkout@v5 - run: | $ExperimentalSDK = "$(Split-Path -Path ${env:SDKROOT} -Parent)/WindowsExperimental.sdk" - swift build --triple x86_64-unknown-windows-msvc -debug-info-format none -c release -Xswiftc -sdk -Xswiftc ${ExperimentalSDK} -Xswiftc -static-stdlib - swift test + swift test -Xswiftc -sdk -Xswiftc ${ExperimentalSDK} -Xswiftc -static-stdlib - name: 'Upload EXE' uses: actions/upload-artifact@v4 From 31aee27a18097cc3a239033aca863068d035c0b5 Mon Sep 17 00:00:00 2001 From: Roman Lavrov Date: Wed, 5 Nov 2025 11:26:30 -0500 Subject: [PATCH 5/5] use x86_64 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc9e855ef..524e438b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,7 +91,7 @@ jobs: - uses: actions/checkout@v5 - run: | $ExperimentalSDK = "$(Split-Path -Path ${env:SDKROOT} -Parent)/WindowsExperimental.sdk" - swift test -Xswiftc -sdk -Xswiftc ${ExperimentalSDK} -Xswiftc -static-stdlib + swift test --triple x86_64-unknown-windows-msvc -Xswiftc -sdk -Xswiftc ${ExperimentalSDK} -Xswiftc -static-stdlib - name: 'Upload EXE' uses: actions/upload-artifact@v4