Skip to content

Commit 2543ac6

Browse files
authored
[CI] Add support for GitHub Actions (#51)
* [CI] Add support for GitHub Actions * Only build the package * Fix the format of Package.swift * Disable Soundness / Unacceptable language check and License headers check * Only build on 6.x and nightly.
1 parent 7e255a9 commit 2543ac6

File tree

2 files changed

+92
-69
lines changed

2 files changed

+92
-69
lines changed

.github/workflows/pull_request.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Pull request
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
tests:
9+
name: Test
10+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
11+
with:
12+
linux_build_command: "swift build"
13+
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}]'
14+
windows_build_command: "swift build"
15+
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]'
16+
soundness:
17+
name: Soundness
18+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
19+
with:
20+
license_header_check_project_name: "Swift.org"
21+
license_header_check_enabled: false
22+
unacceptable_language_check_enabled: false

Package.swift

Lines changed: 70 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,85 +4,86 @@
44
import PackageDescription
55

66
var buildSettings: [CXXSetting] = [
7-
.define("DEBUG", to: "1", .when(configuration: .debug)),
8-
.define("U_ATTRIBUTE_DEPRECATED", to: ""),
9-
.define("U_SHOW_CPLUSPLUS_API", to: "1"),
10-
.define("U_SHOW_INTERNAL_API", to: "1"),
11-
.define("U_STATIC_IMPLEMENTATION"),
12-
.define("U_TIMEZONE", to: "_timezone", .when(platforms: [.windows])),
13-
.define("U_TIMEZONE", to: "timezone",
14-
.when(platforms: [
15-
.iOS,
16-
.macOS,
17-
.tvOS,
18-
.watchOS,
19-
.macCatalyst,
20-
.driverKit,
21-
.android,
22-
.linux,
23-
])),
24-
.define("U_TIMEZONE_PACKAGE", to: "\"icutz44l\""),
25-
.define("U_HAVE_TZSET", to: "0", .when(platforms: [.wasi])),
26-
.define("U_HAVE_TZNAME", to: "0", .when(platforms: [.wasi])),
27-
.define("U_HAVE_TIMEZONE", to: "0", .when(platforms: [.wasi])),
28-
.define("FORTIFY_SOURCE", to: "2"),
29-
.define("STD_INSPIRED"),
30-
.define("MAC_OS_X_VERSION_MIN_REQUIRED", to: "101500"),
31-
.define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])),
32-
.define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])),
33-
.define("U_HAVE_STRTOD_L", to: "1"),
34-
.define("U_HAVE_XLOCALE_H", to: "1"),
35-
.define("U_HAVE_STRING_VIEW", to: "1"),
36-
.define("U_DISABLE_RENAMING", to: "1"),
37-
.define("U_COMBINED_IMPLEMENTATION"),
38-
.define("U_COMMON_IMPLEMENTATION"),
39-
.define("U_I18N_IMPLEMENTATION"),
40-
.define("U_IO_IMPLEMENTATION"),
41-
.define("HAVE_DLFCN_H", to: "0", .when(platforms: [.wasi])),
42-
.define("HAVE_DLOPEN", to: "0", .when(platforms: [.wasi])),
43-
.define("U_ENABLE_DYLOAD", to: "0", .when(platforms: [.wasi])),
7+
.define("DEBUG", to: "1", .when(configuration: .debug)),
8+
.define("U_ATTRIBUTE_DEPRECATED", to: ""),
9+
.define("U_SHOW_CPLUSPLUS_API", to: "1"),
10+
.define("U_SHOW_INTERNAL_API", to: "1"),
11+
.define("U_STATIC_IMPLEMENTATION"),
12+
.define("U_TIMEZONE", to: "_timezone", .when(platforms: [.windows])),
13+
.define(
14+
"U_TIMEZONE", to: "timezone",
15+
.when(platforms: [
16+
.iOS,
17+
.macOS,
18+
.tvOS,
19+
.watchOS,
20+
.macCatalyst,
21+
.driverKit,
22+
.android,
23+
.linux,
24+
])),
25+
.define("U_TIMEZONE_PACKAGE", to: "\"icutz44l\""),
26+
.define("U_HAVE_TZSET", to: "0", .when(platforms: [.wasi])),
27+
.define("U_HAVE_TZNAME", to: "0", .when(platforms: [.wasi])),
28+
.define("U_HAVE_TIMEZONE", to: "0", .when(platforms: [.wasi])),
29+
.define("FORTIFY_SOURCE", to: "2"),
30+
.define("STD_INSPIRED"),
31+
.define("MAC_OS_X_VERSION_MIN_REQUIRED", to: "101500"),
32+
.define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])),
33+
.define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])),
34+
.define("U_HAVE_STRTOD_L", to: "1"),
35+
.define("U_HAVE_XLOCALE_H", to: "1"),
36+
.define("U_HAVE_STRING_VIEW", to: "1"),
37+
.define("U_DISABLE_RENAMING", to: "1"),
38+
.define("U_COMBINED_IMPLEMENTATION"),
39+
.define("U_COMMON_IMPLEMENTATION"),
40+
.define("U_I18N_IMPLEMENTATION"),
41+
.define("U_IO_IMPLEMENTATION"),
42+
.define("HAVE_DLFCN_H", to: "0", .when(platforms: [.wasi])),
43+
.define("HAVE_DLOPEN", to: "0", .when(platforms: [.wasi])),
44+
.define("U_ENABLE_DYLOAD", to: "0", .when(platforms: [.wasi])),
4445

45-
// Where data are stored
46-
.define("ICU_DATA_DIR", to: "\"/usr/share/icu/\""),
47-
.define("USE_PACKAGE_DATA", to: "1"),
48-
.define("APPLE_ICU_CHANGES", to: "1"),
49-
50-
.headerSearchPath("common"),
51-
.headerSearchPath("io"),
52-
.headerSearchPath("i18n"),
53-
.define("SWIFT_PACKAGE", to: "1", .when(platforms: [.linux])),
46+
// Where data are stored
47+
.define("ICU_DATA_DIR", to: "\"/usr/share/icu/\""),
48+
.define("USE_PACKAGE_DATA", to: "1"),
49+
.define("APPLE_ICU_CHANGES", to: "1"),
50+
51+
.headerSearchPath("common"),
52+
.headerSearchPath("io"),
53+
.headerSearchPath("i18n"),
54+
.define("SWIFT_PACKAGE", to: "1", .when(platforms: [.linux])),
5455
]
5556

5657
#if os(Windows)
57-
buildSettings.append(contentsOf: [
58+
buildSettings.append(contentsOf: [
5859
.define("_CRT_SECURE_NO_DEPRECATE"),
5960
.define("U_PLATFORM_USES_ONLY_WIN32_API"),
60-
])
61+
])
6162
#endif
6263

6364
let linkerSettings: [LinkerSetting] = [
64-
.linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])),
65-
.linkedLibrary("wasi-emulated-mman", .when(platforms: [.wasi])),
65+
.linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])),
66+
.linkedLibrary("wasi-emulated-mman", .when(platforms: [.wasi])),
6667
]
6768

6869
let package = Package(
69-
name: "FoundationICU",
70-
products: [
71-
.library(
72-
name: "_FoundationICU",
73-
targets: [
74-
"_FoundationICU"
75-
]
76-
)
77-
],
78-
targets: [
79-
.target(
80-
name: "_FoundationICU",
81-
path: "icuSources",
82-
exclude: ["stubdata"],
83-
cxxSettings: buildSettings,
84-
linkerSettings: linkerSettings
85-
)
86-
],
87-
cxxLanguageStandard: .cxx14
70+
name: "FoundationICU",
71+
products: [
72+
.library(
73+
name: "_FoundationICU",
74+
targets: [
75+
"_FoundationICU"
76+
]
77+
)
78+
],
79+
targets: [
80+
.target(
81+
name: "_FoundationICU",
82+
path: "icuSources",
83+
exclude: ["stubdata"],
84+
cxxSettings: buildSettings,
85+
linkerSettings: linkerSettings
86+
)
87+
],
88+
cxxLanguageStandard: .cxx14
8889
)

0 commit comments

Comments
 (0)