|
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" ] |
| 7 | + branches: ["main", "release/**"] |
22 | 8 | pull_request: |
23 | | - branches: [ "main" ] |
| 9 | + branches: ["main", "release/**"] |
24 | 10 | types: [opened, reopened, synchronize] |
25 | 11 | # Pushing changes to PR stops currently-running CI |
26 | 12 | concurrency: |
27 | 13 | group: ${{ github.workflow }}-${{ github.ref }} |
28 | 14 | cancel-in-progress: true |
29 | 15 | env: |
30 | | - SWIFTLINT_VERSION: 0.57.0 |
31 | | - SWIFTFORMAT_VERSION: 0.54.6 |
| 16 | + SWIFTLINT_VERSION: 0.58.2 |
| 17 | + SWIFTFORMAT_VERSION: 0.55.5 |
32 | 18 | jobs: |
33 | | - swift-tests: |
34 | | - timeout-minutes: 15 |
35 | | - runs-on: ubuntu-latest |
36 | | - strategy: |
37 | | - fail-fast: false |
38 | | - matrix: |
39 | | - swift_version: ['6.0'] |
40 | | - os_version: ['jammy'] |
41 | | - container: |
42 | | - image: swift:${{ matrix.swift_version }}-${{ matrix.os_version }} |
43 | | - name: swift ${{ matrix.swift_version }} tests |
44 | | - steps: |
45 | | - - name: Swift version |
46 | | - run: swift --version |
47 | | - - name: Checkout repository |
48 | | - uses: actions/checkout@v4 |
49 | | - - name: Run tests |
50 | | - run: swift test --configuration release --parallel |
| 19 | + soundness: |
| 20 | + name: soundness |
| 21 | + uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main |
| 22 | + with: |
| 23 | + # https://github.com/swiftlang/swift-package-manager/issues/8103 |
| 24 | + api_breakage_check_enabled: false |
| 25 | + format_check_enabled: false |
| 26 | + tests: |
| 27 | + name: swifttests |
| 28 | + uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main |
| 29 | + with: |
| 30 | + # https://github.com/apple/swift-distributed-tracing/issues/165 |
| 31 | + enable_windows_checks: false |
| 32 | + linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]" |
| 33 | + linux_build_command: "swift test --configuration release" |
51 | 34 | pre-commit: |
52 | 35 | timeout-minutes: 1 |
53 | 36 | runs-on: ubuntu-latest |
54 | 37 | steps: |
55 | | - - name: Checkout repository |
56 | | - uses: actions/checkout@v4 |
57 | | - - name: Install pre-commit |
58 | | - run: pip install pre-commit |
59 | | - - name: Pre-commit checks |
60 | | - # CI will commit to `main` |
61 | | - # swiftformat, swiftlint and license checks tested separately |
62 | | - run: > |
63 | | - SKIP=no-commit-to-branch,check-doc-comments,lockwood-swiftformat,swiftlint,insert-license |
64 | | - pre-commit run --all-files |
| 38 | + - name: Checkout repository |
| 39 | + uses: actions/checkout@v4 |
| 40 | + - name: Install pre-commit |
| 41 | + run: pip install pre-commit |
| 42 | + - name: Pre-commit checks |
| 43 | + # CI will commit to `main` |
| 44 | + # swiftformat, swiftlint and license checks tested separately |
| 45 | + run: > |
| 46 | + SKIP=no-commit-to-branch,check-doc-comments,lockwood-swiftformat,swiftlint,insert-license |
| 47 | + pre-commit run --all-files |
65 | 48 | insert-license: |
66 | 49 | timeout-minutes: 1 |
67 | 50 | runs-on: ubuntu-latest |
68 | 51 | steps: |
69 | | - - name: Checkout repository |
70 | | - uses: actions/checkout@v4 |
71 | | - with: |
72 | | - fetch-depth: 2 |
73 | | - - name: Install pre-commit |
74 | | - run: pip install pre-commit |
75 | | - - name: List changed files |
76 | | - run: git diff --name-only HEAD~1 |
77 | | - - name: Run license check |
78 | | - run: pre-commit run insert-license --files $(git diff --name-only HEAD~1) |
| 52 | + - name: Checkout repository |
| 53 | + uses: actions/checkout@v4 |
| 54 | + with: |
| 55 | + fetch-depth: 2 |
| 56 | + - name: Install pre-commit |
| 57 | + run: pip install pre-commit |
| 58 | + - name: List changed files |
| 59 | + run: git diff --name-only HEAD~1 |
| 60 | + - name: Run license check |
| 61 | + run: pre-commit run insert-license --files $(git diff --name-only HEAD~1) |
79 | 62 | lint: |
80 | 63 | timeout-minutes: 15 |
81 | 64 | runs-on: ubuntu-latest |
82 | 65 | steps: |
83 | | - - name: Checkout repository |
84 | | - uses: actions/checkout@v4 |
85 | | - - name: Cache SwiftLint |
86 | | - id: cache-swiftlint |
87 | | - uses: actions/cache@v4 |
88 | | - with: |
89 | | - path: /tmp/swiftlint/SwiftLint/.build/release/swiftlint |
90 | | - key: ${{ runner.os }}-swiftlint-${{ env.SWIFTLINT_VERSION }} |
91 | | - - name: Install SwiftLint |
92 | | - if: steps.cache-swiftlint.outputs.cache-hit != 'true' |
93 | | - run: | |
94 | | - ci/install-swiftlint.sh |
95 | | - - name: Run SwiftLint |
96 | | - run: /tmp/swiftlint/SwiftLint/.build/release/swiftlint lint --strict . |
| 66 | + - name: Checkout repository |
| 67 | + uses: actions/checkout@v4 |
| 68 | + - name: Cache SwiftLint |
| 69 | + id: cache-swiftlint |
| 70 | + uses: actions/cache@v4 |
| 71 | + with: |
| 72 | + path: /tmp/swiftlint/SwiftLint/.build/debug/swiftlint |
| 73 | + key: ${{ runner.os }}-swiftlint-${{ env.SWIFTLINT_VERSION }} |
| 74 | + - name: Install SwiftLint |
| 75 | + if: steps.cache-swiftlint.outputs.cache-hit != 'true' |
| 76 | + run: | |
| 77 | + ci/install-swiftlint.sh |
| 78 | + - name: Run SwiftLint |
| 79 | + run: /tmp/swiftlint/SwiftLint/.build/debug/swiftlint lint --strict . |
97 | 80 | lockwood-swiftformat: |
98 | 81 | timeout-minutes: 5 |
99 | 82 | runs-on: ubuntu-latest |
100 | 83 | steps: |
101 | | - - name: Checkout repository |
102 | | - uses: actions/checkout@v4 |
103 | | - - name: Cache SwiftFormat |
104 | | - id: cache-swiftformat |
105 | | - uses: actions/cache@v4 |
106 | | - with: |
107 | | - path: /tmp/swiftformat/SwiftFormat/.build/release/swiftformat |
108 | | - key: ${{ runner.os }}-swiftformat-${{ env.SWIFTFORMAT_VERSION }} |
109 | | - - name: Install Lockwood SwiftFormat |
110 | | - if: steps.cache-swiftformat.outputs.cache-hit != 'true' |
111 | | - run: | |
112 | | - ci/install-lockwood-swiftformat.sh |
113 | | - - name: Run SwiftFormat |
114 | | - run: /tmp/swiftformat/SwiftFormat/.build/release/swiftformat --strict . |
| 84 | + - name: Checkout repository |
| 85 | + uses: actions/checkout@v4 |
| 86 | + - name: Cache SwiftFormat |
| 87 | + id: cache-swiftformat |
| 88 | + uses: actions/cache@v4 |
| 89 | + with: |
| 90 | + path: /tmp/swiftformat/SwiftFormat/.build/release/swiftformat |
| 91 | + key: ${{ runner.os }}-swiftformat-${{ env.SWIFTFORMAT_VERSION }} |
| 92 | + - name: Install Lockwood SwiftFormat |
| 93 | + if: steps.cache-swiftformat.outputs.cache-hit != 'true' |
| 94 | + run: | |
| 95 | + ci/install-lockwood-swiftformat.sh |
| 96 | + - name: Run SwiftFormat |
| 97 | + run: /tmp/swiftformat/SwiftFormat/.build/release/swiftformat --strict . |
0 commit comments