From 39fb0514462684bbfbbb68997bd27b5291e23591 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 15:00:23 -0700 Subject: [PATCH 01/14] [CI] Add support for GitHub Actions --- .github/workflows/pull_request.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 00000000..30318180 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,16 @@ +name: Pull request + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + tests: + name: Test + uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main + with: + linux_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' + windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' + soundness: + name: Soundness + uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main From ac69e135b721e9866ac7d131311cdab4cf891ddd Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 15:52:43 -0700 Subject: [PATCH 02/14] Update the license headers --- .github/workflows/pull_request.yml | 2 ++ .license_header_template | 11 +++++++++++ .licenseignore | 12 ++++++++++++ Tests/SWBCoreTests/ProductTypesTests.swift | 11 ++++++++--- .../TestData/CommandLineTool/CommandLineTool/main.c | 12 ++++++++++++ .../Sources/CommandLineToolPackage/main.swift | 12 ++++++++++++ Utilities/swift-ci-perf-tests.sh | 13 ++++++++++++- 7 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 .license_header_template create mode 100644 .licenseignore diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 30318180..a723fe03 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,3 +14,5 @@ jobs: soundness: name: Soundness uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main + with: + license_header_check_project_name: "Swift" diff --git a/.license_header_template b/.license_header_template new file mode 100644 index 00000000..52d6f278 --- /dev/null +++ b/.license_header_template @@ -0,0 +1,11 @@ +@@===----------------------------------------------------------------------===@@ +@@ +@@ This source file is part of the Swift open source project +@@ +@@ Copyright (c) YEARS Apple Inc. and the Swift project authors +@@ Licensed under Apache License v2.0 with Runtime Library Exception +@@ +@@ See http://swift.org/LICENSE.txt for license information +@@ See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +@@ +@@===----------------------------------------------------------------------===@@ diff --git a/.licenseignore b/.licenseignore new file mode 100644 index 00000000..cf70e208 --- /dev/null +++ b/.licenseignore @@ -0,0 +1,12 @@ +**/*.mlmodel +**/*.pbxproj +**/*.png +**/*.strings +**/*.xcbuildrules +**/*.xcspec +**/*.xcworkspacedata +**/Package.swift +.dir-locals.el +.editorconfig +CODEOWNERS +Package.swift diff --git a/Tests/SWBCoreTests/ProductTypesTests.swift b/Tests/SWBCoreTests/ProductTypesTests.swift index 3baeb0ef..5bc412bb 100644 --- a/Tests/SWBCoreTests/ProductTypesTests.swift +++ b/Tests/SWBCoreTests/ProductTypesTests.swift @@ -1,9 +1,14 @@ +//===----------------------------------------------------------------------===// // -// ProductTypesTests.swift -// SWBCoreTests +// This source file is part of the Swift open source project // -// Copyright © 2024 Apple Inc. All rights reserved. +// Copyright (c) 2025 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception // +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// import Testing diff --git a/Tests/SwiftBuildTests/TestData/CommandLineTool/CommandLineTool/main.c b/Tests/SwiftBuildTests/TestData/CommandLineTool/CommandLineTool/main.c index 33c14ce1..cdee1235 100644 --- a/Tests/SwiftBuildTests/TestData/CommandLineTool/CommandLineTool/main.c +++ b/Tests/SwiftBuildTests/TestData/CommandLineTool/CommandLineTool/main.c @@ -1,3 +1,15 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift open source project +// +// Copyright (c) 2025 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + int main() { return 0; } diff --git a/Tests/SwiftBuildTests/TestData/CommandLineToolPackage/Sources/CommandLineToolPackage/main.swift b/Tests/SwiftBuildTests/TestData/CommandLineToolPackage/Sources/CommandLineToolPackage/main.swift index e69de29b..380508dc 100644 --- a/Tests/SwiftBuildTests/TestData/CommandLineToolPackage/Sources/CommandLineToolPackage/main.swift +++ b/Tests/SwiftBuildTests/TestData/CommandLineToolPackage/Sources/CommandLineToolPackage/main.swift @@ -0,0 +1,12 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift open source project +// +// Copyright (c) 2025 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + diff --git a/Utilities/swift-ci-perf-tests.sh b/Utilities/swift-ci-perf-tests.sh index 255c7e09..92b4f169 100755 --- a/Utilities/swift-ci-perf-tests.sh +++ b/Utilities/swift-ci-perf-tests.sh @@ -1,4 +1,15 @@ -#!/usr/bin/env bash +#!/bin/bash +##===----------------------------------------------------------------------===## +## +## This source file is part of the Swift open source project +## +## Copyright (c) 2025 Apple Inc. and the Swift project authors +## Licensed under Apache License v2.0 with Runtime Library Exception +## +## See http://swift.org/LICENSE.txt for license information +## See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +## +##===----------------------------------------------------------------------===## set -euo pipefail From 2ec278caeea4b1311330eb98255cdd55fc2160a1 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 16:01:09 -0700 Subject: [PATCH 03/14] Add libsqlite3-dev to the pre build command --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a723fe03..8855073e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,6 +10,7 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: linux_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' + linux_pre_build_command: apt-get update && apt-get install -y libsqlite3-dev windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' soundness: name: Soundness From 58a09b82ae41248ee11649c250c61ec3d99d0ae9 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 16:18:01 -0700 Subject: [PATCH 04/14] For linux action add libncurses5-dev --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8855073e..1a18d91b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,7 +10,7 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: linux_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' - linux_pre_build_command: apt-get update && apt-get install -y libsqlite3-dev + linux_pre_build_command: apt-get update && apt-get install -y libsqlite3-dev libncurses5-dev windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' soundness: name: Soundness From 2015da9ced9e85aab7ebabbb4c3a0d2dae3548da Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 22:06:54 -0700 Subject: [PATCH 05/14] Disable ABI, Unacceptable lang, and format checks --- .github/workflows/pull_request.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1a18d91b..53dfc0a3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -16,4 +16,7 @@ jobs: name: Soundness uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main with: - license_header_check_project_name: "Swift" + license_header_check_project_name: "Swift" + api_breakage_check_enabled: false + unacceptable_language_check_enabled: false + format_check_enabled: false From adb264395fe1eb0d03c249d722be5d0d4be2c79d Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 22:31:05 -0700 Subject: [PATCH 06/14] Only build for main and 6.2 --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 53dfc0a3..c417c37a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,9 +9,9 @@ jobs: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: - linux_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' linux_pre_build_command: apt-get update && apt-get install -y libsqlite3-dev libncurses5-dev - windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' + linux_swift_versions: '["nightly-main", "nightly-6.2"]' + windows_swift_versions: '["nightly-main"]' soundness: name: Soundness uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main From 831cb027508db493fb27e59583dbf20306ad0daa Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 22:45:21 -0700 Subject: [PATCH 07/14] Remove strings, xcbuildrules, and xcspec from .licenseignore --- .licenseignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.licenseignore b/.licenseignore index cf70e208..21fbce89 100644 --- a/.licenseignore +++ b/.licenseignore @@ -1,9 +1,6 @@ **/*.mlmodel **/*.pbxproj **/*.png -**/*.strings -**/*.xcbuildrules -**/*.xcspec **/*.xcworkspacedata **/Package.swift .dir-locals.el From 0ae6d6a677cd9feefab2b5decd3c9ed770f1823c Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 22:52:07 -0700 Subject: [PATCH 08/14] Add support for multiple Linux platforms --- .github/workflows/pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c417c37a..7702f973 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,7 +9,8 @@ jobs: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: - linux_pre_build_command: apt-get update && apt-get install -y libsqlite3-dev libncurses5-dev + linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9"]' + linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses5-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel) linux_swift_versions: '["nightly-main", "nightly-6.2"]' windows_swift_versions: '["nightly-main"]' soundness: From 9cd885734ed15dc2c5c7aff0c9c2daee1888d939 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 27 Apr 2025 22:54:25 -0700 Subject: [PATCH 09/14] Cancel in progress builds --- .github/workflows/pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7702f973..acf0b73f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -4,6 +4,10 @@ on: pull_request: types: [opened, reopened, synchronize] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: tests: name: Test From f7bc9828cdf44f9e790cff45beb2822669ef9279 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 28 Apr 2025 11:41:03 -0700 Subject: [PATCH 10/14] Also include libncurses-dev for UBI OS --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index acf0b73f..e840f0bf 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,7 +14,7 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9"]' - linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses5-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel) + linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses5-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel libncurses-dev) linux_swift_versions: '["nightly-main", "nightly-6.2"]' windows_swift_versions: '["nightly-main"]' soundness: From 51940c9c1c0016f97108123501959d3185f1dd76 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 28 Apr 2025 11:48:04 -0700 Subject: [PATCH 11/14] Update pull_request.yml remove the libncurses-dev from UBI. --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e840f0bf..acf0b73f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,7 +14,7 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9"]' - linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses5-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel libncurses-dev) + linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses5-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel) linux_swift_versions: '["nightly-main", "nightly-6.2"]' windows_swift_versions: '["nightly-main"]' soundness: From 609aa048e6aee7a2b5c0112e45ae2cddca526493 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 28 Apr 2025 18:04:40 -0700 Subject: [PATCH 12/14] Fix the package names --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index acf0b73f..1c73253c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,7 +14,7 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9"]' - linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses5-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel) + linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel ncurses-devel) linux_swift_versions: '["nightly-main", "nightly-6.2"]' windows_swift_versions: '["nightly-main"]' soundness: From 0a59da58452a1f5edda9da561ad5f56e5f98fac6 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 28 Apr 2025 18:05:00 -0700 Subject: [PATCH 13/14] Add --no-parallel to Linux build command so we can try to find which test is crashing --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1c73253c..80324b70 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,6 +15,7 @@ jobs: with: linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9"]' linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel ncurses-devel) + linux_build_command: 'swift test --no-parallel' linux_swift_versions: '["nightly-main", "nightly-6.2"]' windows_swift_versions: '["nightly-main"]' soundness: From 932ef8a7e9afaefb1a9b92d5c820d022781870d3 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 29 Apr 2025 00:00:12 -0700 Subject: [PATCH 14/14] Use swift build for Linux and Windows --- .github/workflows/pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 80324b70..efc6d05e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,9 +15,10 @@ jobs: with: linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9"]' linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel ncurses-devel) - linux_build_command: 'swift test --no-parallel' + linux_build_command: 'swift build' linux_swift_versions: '["nightly-main", "nightly-6.2"]' windows_swift_versions: '["nightly-main"]' + windows_build_command: 'swift build' soundness: name: Soundness uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main