Skip to content

Commit 7b3e2ae

Browse files
committed
Symlink OpenAPI spec into OFREP target
1 parent 56563a5 commit 7b3e2ae

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

.github/workflows/soundness.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,15 @@ jobs:
4040
SWIFTLY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
- name: Run format check
4242
run: ./scripts/check-swift-format.sh
43+
44+
broken-symlinks-check:
45+
name: Broken symlinks check
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 1
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
with:
52+
submodules: true
53+
- name: Run broken symlinks check
54+
run: ./scripts/check-broken-symlinks.sh

Sources/OFREP/openapi.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../protocol/service/openapi.yaml

scripts/check-broken-symlinks.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
##===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift OpenFeature open source project
5+
##
6+
## Copyright (c) 2024 the Swift OpenFeature project authors
7+
## Licensed under Apache License v2.0
8+
##
9+
## See LICENSE.txt for license information
10+
##
11+
## SPDX-License-Identifier: Apache-2.0
12+
##
13+
##===----------------------------------------------------------------------===##
14+
15+
##===----------------------------------------------------------------------===##
16+
##
17+
## This source file is part of the Swift.org open source project
18+
##
19+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
20+
## Licensed under Apache License v2.0 with Runtime Library Exception
21+
##
22+
## See https://swift.org/LICENSE.txt for license information
23+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
24+
##
25+
##===----------------------------------------------------------------------===##
26+
27+
set -euo pipefail
28+
29+
log() { printf -- "** %s\n" "$*" >&2; }
30+
error() { printf -- "** ERROR: %s\n" "$*" >&2; }
31+
fatal() { error "$@"; exit 1; }
32+
33+
log "Checking for broken symlinks..."
34+
num_broken_symlinks=0
35+
while read -r -d '' file; do
36+
if ! test -e "./${file}"; then
37+
error "Broken symlink: ${file}"
38+
((num_broken_symlinks++))
39+
fi
40+
done < <(git ls-files -z)
41+
42+
if [ "${num_broken_symlinks}" -gt 0 ]; then
43+
fatal "❌ Found ${num_broken_symlinks} symlinks."
44+
fi
45+
46+
log "✅ Found 0 symlinks."

0 commit comments

Comments
 (0)