-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Henrik Panhans <[email protected]>
- Loading branch information
1 parent
902c8c4
commit 2c51d6a
Showing
54 changed files
with
509 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Linting | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install swift-format | ||
run: brew install swift-format | ||
- name: Lint code | ||
run: Scripts/lint-swift-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
name: Swift | ||
name: Tests | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-14 | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Configure Xcode version | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: "15.2" | ||
- name: Build | ||
run: swift build -v | ||
xcode-version: "16.0" | ||
- name: Run tests | ||
run: swift test -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
HOOKS=$(git rev-parse --git-path hooks) | ||
ROOT=$(git rev-parse --show-toplevel) | ||
|
||
# Symlink the hooks from scripts/hooks to the $HOOKS directory | ||
for hook in "${ROOT}"/Scripts/hooks/*; do | ||
HOOK_NAME=$(basename $hook) | ||
echo "Symlinking $HOOK_NAME to $HOOKS/$HOOK_NAME" | ||
ln -sf $hook $HOOKS/$HOOK_NAME | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
GIT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
swift-format format \ | ||
--recursive \ | ||
--parallel \ | ||
--in-place \ | ||
--configuration $GIT_ROOT/swift-format.json \ | ||
$GIT_ROOT/Sources/ \ | ||
$GIT_ROOT/Tests/ \ | ||
$GIT_ROOT/Package.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
GIT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
SWIFT_FORMAT_OUTPUT=$($GIT_ROOT/Scripts/lint-swift-code) | ||
RETURNED_ERROR=$? | ||
|
||
if [ $RETURNED_ERROR -ne 0 ]; then | ||
echo "Error: Swift code is not formatted correctly. Please run 'Scripts/format-swift-code' to fix most errors." | ||
echo "$SWIFT_FORMAT_OUTPUT" | ||
fi | ||
|
||
exit $RETURNED_ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
GIT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
swift-format lint \ | ||
--recursive \ | ||
--parallel \ | ||
--strict \ | ||
--configuration $GIT_ROOT/swift-format.json \ | ||
$GIT_ROOT/Sources/ \ | ||
$GIT_ROOT/Tests/ \ | ||
$GIT_ROOT/Package.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.