1
- # Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
1
+ # Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
2
2
#
3
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
4
# you may not use this file except in compliance with the License.
21
21
branches : [ "main", "release/**" ]
22
22
pull_request :
23
23
branches : [ "main", "release/**" ]
24
- types : [opened, reopened, synchronize, ready_for_review ]
24
+ types : [opened, reopened, synchronize]
25
25
# Pushing changes to PR stops currently-running CI
26
26
concurrency :
27
27
group : ${{ github.workflow }}-${{ github.ref }}
@@ -37,15 +37,18 @@ jobs:
37
37
strategy :
38
38
fail-fast : false
39
39
matrix :
40
- swift : ["5.10", "6.0"]
41
- name : swift ${{ matrix.swift }} tests
40
+ swift_version : ['5.10', '6.0']
41
+ os_version : ['jammy']
42
+ container :
43
+ image : swift:${{ matrix.swift_version }}-${{ matrix.os_version }}
44
+ name : swift ${{ matrix.swift_version }} tests
42
45
steps :
43
-
44
- with :
45
- version : ${{ matrix.swift }}
46
- - uses : actions/checkout@v4
46
+ - name : Swift version
47
+ run : swift --version
48
+ - name : Checkout repository
49
+ uses : actions/checkout@v4
47
50
- name : Install jemalloc
48
- run : sudo apt-get install -y libjemalloc-dev
51
+ run : apt-get update && apt-get install -y libjemalloc-dev
49
52
- name : Run tests
50
53
run : swift test --configuration release --parallel
51
54
- name : Run snippets
@@ -58,20 +61,36 @@ jobs:
58
61
timeout-minutes : 1
59
62
runs-on : ubuntu-latest
60
63
steps :
61
- - uses : actions/checkout@v4
64
+ - name : Checkout repository
65
+ uses : actions/checkout@v4
62
66
- name : Install pre-commit
63
67
run : pip install pre-commit
64
68
- name : Pre-commit checks
65
69
# CI will commit to `main`
66
- # swiftformat & swiftlint tested separately
70
+ # swiftformat, swiftlint and license checks tested separately
67
71
run : >
68
- SKIP=no-commit-to-branch,lockwood-swiftformat,swiftlint,check-doc-comments
72
+ SKIP=no-commit-to-branch,lockwood-swiftformat,swiftlint,check-doc-comments,insert-license
69
73
pre-commit run --all-files
74
+ insert-license :
75
+ timeout-minutes : 1
76
+ runs-on : ubuntu-latest
77
+ steps :
78
+ - name : Checkout repository
79
+ uses : actions/checkout@v4
80
+ with :
81
+ fetch-depth : 2
82
+ - name : Install pre-commit
83
+ run : pip install pre-commit
84
+ - name : List changed files
85
+ run : git diff --name-only HEAD~1
86
+ - name : Run license check
87
+ run : pre-commit run insert-license --files $(git diff --name-only HEAD~1)
70
88
lint :
71
89
timeout-minutes : 15
72
90
runs-on : ubuntu-latest
73
91
steps :
74
- - uses : actions/checkout@v4
92
+ - name : Checkout repository
93
+ uses : actions/checkout@v4
75
94
- name : Cache SwiftLint
76
95
id : cache-swiftlint
77
96
uses : actions/cache@v4
88
107
timeout-minutes : 5
89
108
runs-on : ubuntu-latest
90
109
steps :
91
- - uses : actions/checkout@v4
110
+ - name : Checkout repository
111
+ uses : actions/checkout@v4
92
112
- name : Cache SwiftFormat
93
113
id : cache-swiftformat
94
114
uses : actions/cache@v4
@@ -105,6 +125,7 @@ jobs:
105
125
timeout-minutes : 5
106
126
runs-on : ubuntu-latest
107
127
steps :
108
- - uses : actions/checkout@v4
128
+ - name : Checkout repository
129
+ uses : actions/checkout@v4
109
130
- name : Check documentation comments
110
131
run : ci/run-apple-swift-format.sh
0 commit comments