File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 11
11
with :
12
12
benchmarks_linux_package_path : " Benchmarks"
13
13
license_header_check_project_name : " SwiftNIO"
14
+ format_check_enabled : false
Original file line number Diff line number Diff line change 39
39
type : string
40
40
description : " Name of the project called out in the license header."
41
41
required : true
42
+ broken_symlink_check_enabled :
43
+ type : boolean
44
+ description : " Boolean to enable the broken symlink check job. Defaults to true."
45
+ default : true
46
+ format_check_enabled :
47
+ type : boolean
48
+ description : " Boolean to enable the format check job. Defaults to true."
49
+ default : true
42
50
43
51
# # We are cancelling previously triggered workflow runs
44
52
concurrency :
@@ -159,3 +167,27 @@ jobs:
159
167
env :
160
168
PROJECT_NAME : ${{ inputs.license_header_check_project_name }}
161
169
run : curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-license-header.sh | bash
170
+
171
+ broken-symlink-check :
172
+ name : Broken symlinks check
173
+ if : ${{ inputs.broken_symlink_check_enabled }}
174
+ runs-on : ubuntu-latest
175
+ timeout-minutes : 1
176
+ steps :
177
+ - name : Checkout repository
178
+ uses : actions/checkout@v4
179
+ - name : Run broken symlinks check
180
+ run : curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-broken-symlinks.sh | bash
181
+
182
+ format-check :
183
+ name : Format check
184
+ if : ${{ inputs.format_check_enabled }}
185
+ runs-on : ubuntu-latest
186
+ container :
187
+ image : swiftlang/swift:nightly-6.0-jammy
188
+ timeout-minutes : 5
189
+ steps :
190
+ - name : Checkout repository
191
+ uses : actions/checkout@v4
192
+ - name : Run format check
193
+ run : swift format lint --parallel --recursive --strict
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # #===----------------------------------------------------------------------===##
3
+ # #
4
+ # # This source file is part of the SwiftNIO open source project
5
+ # #
6
+ # # Copyright (c) 2024 Apple Inc. and the SwiftNIO project authors
7
+ # # Licensed under Apache License v2.0
8
+ # #
9
+ # # See LICENSE.txt for license information
10
+ # # See CONTRIBUTORS.txt for the list of SwiftNIO project authors
11
+ # #
12
+ # # SPDX-License-Identifier: Apache-2.0
13
+ # #
14
+ # #===----------------------------------------------------------------------===##
15
+ set -euo pipefail
16
+
17
+ log () { printf -- " ** %s\n" " $* " >&2 ; }
18
+ error () { printf -- " ** ERROR: %s\n" " $* " >&2 ; }
19
+ fatal () { error " $@ " ; exit 1; }
20
+
21
+ log " Checking for broken symlinks..."
22
+ num_broken_symlinks=0
23
+ while read -r -d ' ' file; do
24
+ if ! test -e " ./${file} " ; then
25
+ error " Broken symlink: ${file} "
26
+ (( num_broken_symlinks++ ))
27
+ fi
28
+ done < <( git ls-files -z)
29
+
30
+ if [ " ${num_broken_symlinks} " -gt 0 ]; then
31
+ fatal " ❌ Found ${num_broken_symlinks} symlinks."
32
+ fi
33
+
34
+ log " ✅ Found 0 symlinks."
You can’t perform that action at this time.
0 commit comments