1
- # Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
name : CI
16
2
permissions :
17
3
contents : read
18
4
on :
19
5
workflow_dispatch :
20
6
push :
21
- branches : [ "main", "release/**" ]
7
+ branches : ["main", "release/**"]
22
8
pull_request :
23
- branches : [ "main", "release/**" ]
9
+ branches : ["main", "release/**"]
24
10
types : [opened, reopened, synchronize]
25
11
# Pushing changes to PR stops currently-running CI
26
12
concurrency :
32
18
SWIFTFORMAT_VERSION : 0.54.6
33
19
SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING : 1
34
20
jobs :
35
- swift-tests :
36
- timeout-minutes : 15
37
- runs-on : ubuntu-latest
38
- strategy :
39
- fail-fast : false
40
- matrix :
41
- swift_version : ['6.0']
42
- os_version : ['jammy']
43
- container :
44
- image : swift:${{ matrix.swift_version }}-${{ matrix.os_version }}
45
- name : swift ${{ matrix.swift_version }} tests
46
- steps :
47
- - name : Swift version
48
- run : swift --version
49
- - name : Checkout repository
50
- uses : actions/checkout@v4
51
- - name : Install jemalloc
52
- run : apt-get update && apt-get install -y libjemalloc-dev
53
- - name : Run tests
54
- run : swift test --configuration release --parallel
55
- - name : Run snippets
56
- run : >
21
+ soundness :
22
+ name : soundness
23
+ uses : swiftlang/github-workflows/.github/workflows/soundness.yml@main
24
+ with :
25
+ # https://github.com/swiftlang/swift-package-manager/issues/8103
26
+ api_breakage_check_enabled : false
27
+ format_check_enabled : false
28
+ tests :
29
+ name : swifttests
30
+ uses : swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
31
+ with :
32
+ enable_windows_checks : false
33
+ # TODO: remove 5.8 after https://github.com/swiftlang/github-workflows/pull/107
34
+ linux_exclude_swift_versions : " [{\" swift_version\" : \" 5.8\" }, {\" swift_version\" : \" 5.9\" }, {\" swift_version\" : \" 5.10\" }]"
35
+ linux_pre_build_command : " apt-get update && apt-get install -y libjemalloc-dev"
36
+ linux_build_command : >
37
+ swift test --configuration release;
57
38
for filename in $(find Snippets -name \*.swift); do
58
39
basename=$(basename "$filename" .swift)
59
40
swift run --configuration release ${basename}
@@ -62,71 +43,71 @@ jobs:
62
43
timeout-minutes : 1
63
44
runs-on : ubuntu-22.04
64
45
steps :
65
- - name : Checkout repository
66
- uses : actions/checkout@v4
67
- - name : Install pre-commit
68
- run : pip install pre-commit
69
- - name : Pre-commit checks
70
- # CI will commit to `main`
71
- # swiftformat, swiftlint and license checks tested separately
72
- run : >
73
- SKIP=no-commit-to-branch,lockwood-swiftformat,swiftlint,check-doc-comments,insert-license
74
- pre-commit run --all-files
46
+ - name : Checkout repository
47
+ uses : actions/checkout@v4
48
+ - name : Install pre-commit
49
+ run : pip install pre-commit
50
+ - name : Pre-commit checks
51
+ # CI will commit to `main`
52
+ # swiftformat, swiftlint and license checks tested separately
53
+ run : >
54
+ SKIP=no-commit-to-branch,lockwood-swiftformat,swiftlint,check-doc-comments,insert-license
55
+ pre-commit run --all-files
75
56
insert-license :
76
57
timeout-minutes : 1
77
58
runs-on : ubuntu-22.04
78
59
steps :
79
- - name : Checkout repository
80
- uses : actions/checkout@v4
81
- with :
82
- fetch-depth : 2
83
- - name : Install pre-commit
84
- run : pip install pre-commit
85
- - name : List changed files
86
- run : git diff --name-only HEAD~1
87
- - name : Run license check
88
- run : pre-commit run insert-license --files $(git diff --name-only HEAD~1)
60
+ - name : Checkout repository
61
+ uses : actions/checkout@v4
62
+ with :
63
+ fetch-depth : 2
64
+ - name : Install pre-commit
65
+ run : pip install pre-commit
66
+ - name : List changed files
67
+ run : git diff --name-only HEAD~1
68
+ - name : Run license check
69
+ run : pre-commit run insert-license --files $(git diff --name-only HEAD~1)
89
70
lint :
90
71
timeout-minutes : 15
91
72
runs-on : ubuntu-22.04
92
73
steps :
93
- - name : Checkout repository
94
- uses : actions/checkout@v4
95
- - name : Cache SwiftLint
96
- id : cache-swiftlint
97
- uses : actions/cache@v4
98
- with :
99
- path : /tmp/swiftlint/SwiftLint/.build/release/swiftlint
100
- key : ${{ runner.os }}-swiftlint-${{ env.SWIFTLINT_VERSION }}
101
- - name : Install SwiftLint
102
- if : steps.cache-swiftlint.outputs.cache-hit != 'true'
103
- run : |
104
- ci/install-swiftlint.sh
105
- - name : Run SwiftLint
106
- run : /tmp/swiftlint/SwiftLint/.build/release/swiftlint lint --strict .
74
+ - name : Checkout repository
75
+ uses : actions/checkout@v4
76
+ - name : Cache SwiftLint
77
+ id : cache-swiftlint
78
+ uses : actions/cache@v4
79
+ with :
80
+ path : /tmp/swiftlint/SwiftLint/.build/release/swiftlint
81
+ key : ${{ runner.os }}-swiftlint-${{ env.SWIFTLINT_VERSION }}
82
+ - name : Install SwiftLint
83
+ if : steps.cache-swiftlint.outputs.cache-hit != 'true'
84
+ run : |
85
+ ci/install-swiftlint.sh
86
+ - name : Run SwiftLint
87
+ run : /tmp/swiftlint/SwiftLint/.build/release/swiftlint lint --strict .
107
88
lockwood-swiftformat :
108
89
timeout-minutes : 5
109
90
runs-on : ubuntu-22.04
110
91
steps :
111
- - name : Checkout repository
112
- uses : actions/checkout@v4
113
- - name : Cache SwiftFormat
114
- id : cache-swiftformat
115
- uses : actions/cache@v4
116
- with :
117
- path : /tmp/swiftformat/SwiftFormat/.build/release/swiftformat
118
- key : ${{ runner.os }}-swiftformat-${{ env.SWIFTFORMAT_VERSION }}
119
- - name : Install Lockwood SwiftFormat
120
- if : steps.cache-swiftformat.outputs.cache-hit != 'true'
121
- run : |
122
- ci/install-lockwood-swiftformat.sh
123
- - name : Run SwiftFormat
124
- run : /tmp/swiftformat/SwiftFormat/.build/release/swiftformat --strict .
92
+ - name : Checkout repository
93
+ uses : actions/checkout@v4
94
+ - name : Cache SwiftFormat
95
+ id : cache-swiftformat
96
+ uses : actions/cache@v4
97
+ with :
98
+ path : /tmp/swiftformat/SwiftFormat/.build/release/swiftformat
99
+ key : ${{ runner.os }}-swiftformat-${{ env.SWIFTFORMAT_VERSION }}
100
+ - name : Install Lockwood SwiftFormat
101
+ if : steps.cache-swiftformat.outputs.cache-hit != 'true'
102
+ run : |
103
+ ci/install-lockwood-swiftformat.sh
104
+ - name : Run SwiftFormat
105
+ run : /tmp/swiftformat/SwiftFormat/.build/release/swiftformat --strict .
125
106
check-doc-comments :
126
107
timeout-minutes : 5
127
108
runs-on : ubuntu-22.04
128
109
steps :
129
- - name : Checkout repository
130
- uses : actions/checkout@v4
131
- - name : Check documentation comments
132
- run : ci/run-apple-swift-format.sh
110
+ - name : Checkout repository
111
+ uses : actions/checkout@v4
112
+ - name : Check documentation comments
113
+ run : ci/run-apple-swift-format.sh
0 commit comments