Runs
Check#1
- Workflow
- .github/workflows/check.yml
- Event
- push
- Ref
- main
- Commit
- 114d5bd
- Actor
- dynd
- Created
- Queued
- 0:01
- Duration
- 3:22
swift
Took 1:21Runs on self-hostedminiRunner miniTimeout 360 minSteps
200 lines· Log complete
Run actions/checkout@v5
[command]/usr/bin/git remote add origin https://git.cafe/dynd/modern-swift
▸ Disabling automatic garbage collection
[command]/usr/bin/git config --local gc.auto 0
▸ Setting up auth
[command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
[command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/git\.cafe\/\.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/git\.cafe\/\.extraheader' && git config --local --unset-all 'http.https://git.cafe/.extraheader' || :"
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
[command]/usr/bin/git config --local http.https://git.cafe/.extraheader AUTHORIZATION: basic ***
▸ Fetching the repository
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +114d5bd467f7a8dd7eeec941b56ec1a873444dc6:refs/remotes/origin/main
From https://git.cafe/dynd/modern-swift
* [new ref] 114d5bd467f7a8dd7eeec941b56ec1a873444dc6 -> origin/main
▸ Determining the checkout info
[command]/usr/bin/git sparse-checkout disable
[command]/usr/bin/git config --local --unset-all extensions.worktreeConfig
▸ Checking out the ref
[command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main
Reset branch 'main'
branch 'main' set up to track 'origin/main'.
[command]/usr/bin/git log -1 --format=%H
114d5bd467f7a8dd7eeec941b56ec1a873444dc6
Run maxim-lobanov/setup-xcode@v1
▸ Run maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
env:
BLOCKS: .build/blocks
Switching Xcode to version 'latest-stable'...
Xcode is set to 27.2.0 (27B52)
The Swift version matches the one the skills and README describe
▸ Run actual=$(swift --version 2>&1 | sed -n 's/.*Swift version \([0-9]*\.[0-9]*\).*/\1/p' | head -1)
actual=$(swift --version 2>&1 | sed -n 's/.*Swift version \([0-9]*\.[0-9]*\).*/\1/p' | head -1)
echo "Swift $actual"
for doc in README.md skills/swift-best-practices/SKILL.md; do
stated=$(sed -n 's/^The rules\( below\)\{0,1\} describe Swift \([0-9.]*\) .*/\2/p' "$doc")
if [ "$stated" != "$actual" ]; then
echo "::error file=$doc::describes Swift $stated, but CI runs Swift $actual"
exit 1
fi
done
shell: /bin/bash -e {0}
env:
BLOCKS: .build/blocks
MD_APPLE_SDK_ROOT: /Applications/Xcode.app
Swift 6.4
Each file in lints/check triggers the warning it expects
▸ Run # Strip the color and hyperlink escapes that swift build adds to diagnostics.
# Strip the color and hyperlink escapes that swift build adds to diagnostics.
output=$( (swift build --package-path lints; swift format lint --recursive lints/check) 2>&1 |
perl -pe 's/\e\]8;;.*?\e\\//g; s/\e\[[0-9;]*m//g')
failed=0
for file in lints/check/*.swift; do
rule=$(sed -n 's/^\/\/ Expect: .*\[\(.*\)\].*/\1/p' "$file")
if ! grep -F "$(basename "$file")" <<<"$output" | grep -F "[$rule]" > /dev/null; then
echo "::error file=$file::expected [$rule]"
failed=1
fi
done
exit $failed
shell: /bin/bash -e {0}
env:
BLOCKS: .build/blocks
MD_APPLE_SDK_ROOT: /Applications/Xcode.app
Extract every Swift block in the skills
▸ Run mkdir -p "$BLOCKS"
mkdir -p "$BLOCKS"
for doc in $(git ls-files 'skills/*.md' ':!:skills/*/evals/*'); do
awk -v prefix="$BLOCKS/$(echo "$doc" | tr / _)" \
-v package=".github/examples/$(basename "$doc" .md)" '
/^```swift/ { n++; on = 1; block = ""; next }
/^```/ && on {
on = 0
if (block ~ /(^|\n)\/\/ Sources\//) {
split(block, lines, "\n")
for (i = 1; i < length(lines); i++) {
if (lines[i] ~ /^\/\/ Sources\//) {
blank = 0
file = package "/" substr(lines[i], 4)
system("mkdir -p \"$(dirname \"" file "\")\"")
} else if (lines[i] == "") blank++
else {
for (; blank > 0; blank--) print "" > file
print lines[i] > file
}
}
} else printf "%s", block > (prefix "-" n ".swift")
next
}
on { block = block $0 "\n" }' "$doc"
done
mkdir -p "$BLOCKS/diffs"
for doc in $(git ls-files 'skills/*.md' ':!:skills/*/evals/*' ':!:skills/*/assets/*'); do
awk -v prefix="$BLOCKS/diffs/$(echo "$doc" | tr / _)" '
/^```diff/ { n++; on = 1; file = prefix "-" n ".swift"; print "import Foundation" > file; next }
/^```/ { on = 0 }
on && /^[ +]/ { print substr($0, 2) > file }
on && /^$/ { print "" > file }' "$doc"
done
shell: /bin/bash -e {0}
env:
BLOCKS: .build/blocks
MD_APPLE_SDK_ROOT: /Applications/Xcode.app
Build the package examples
▸ Run for package in .github/examples/*/; do
for package in .github/examples/*/; do
swift build --package-path "$package"
done
shell: /bin/bash -e {0}
env:
BLOCKS: .build/blocks
MD_APPLE_SDK_ROOT: /Applications/Xcode.app
Fetching https://github.com/swiftlang/swift-syntax.git
[1/82649] Fetching swift-syntax
Fetched https://github.com/swiftlang/swift-syntax.git (13.85s)
Computing version for https://github.com/swiftlang/swift-syntax.git
Computed https://github.com/swiftlang/swift-syntax.git at 604.0.0 (15.74s)
Creating working copy for https://github.com/swiftlang/swift-syntax.git
Working copy of https://github.com/swiftlang/swift-syntax.git resolved at 604.0.0
Downloading package prebuilt https://download.swift.org/prebuilts/swift-syntax/604.0.0/swiftlang-6.4.2.1.9-macosx27.2-MacroSupport.zip
Downloaded https://download.swift.org/prebuilts/swift-syntax/604.0.0/swiftlang-6.4.2.1.9-macosx27.2-MacroSupport.zip (0.64s)
Building for debugging...
[Planning deferred tasks]
[25 / 38]
[26 / 39] MyMacrosPlugin
[35 / 67]
[39 / 67]
[44 / 67]
[47 / 67]
[50 / 67]
[52 / 67]
[55 / 67] MyMacrosPlugin
[57 / 67] MyMacrosPlugin
[62 / 70] MyMacros
Build complete! (2,97 secs)
Compile the blocks with the settings from lints/Package.swift
▸ Run dev=$(xcode-select -p)
dev=$(xcode-select -p)
toolchain=$(dirname "$(dirname "$(xcrun -f swiftc)")")
failed=0
for block in "$BLOCKS"/*.swift "$BLOCKS"/diffs/*.swift; do
mode=-parse-as-library
grep -q '^let package' "$block" && mode=
case "$block" in "$BLOCKS"/diffs/*) mode= ;; esac
for isolation in nonisolated MainActor; do
if ! xcrun swiftc -emit-sil -o /dev/null -swift-version 6 $mode \
-default-isolation "$isolation" \
-enable-upcoming-feature NonisolatedNonsendingByDefault \
-enable-upcoming-feature InferIsolatedConformances \
-enable-upcoming-feature ExistentialAny \
-enable-upcoming-feature InternalImportsByDefault \
-strict-memory-safety \
-Werror ExistentialAny -Werror StrictMemorySafety -Werror DeprecatedDeclaration \
-I "$toolchain/lib/swift/pm/ManifestAPI" -package-description-version 6.2 \
-plugin-path "$toolchain/lib/swift/host/plugins/testing" \
-F "$dev/Platforms/MacOSX.platform/Developer/Library/Frameworks" \
-I "$dev/Platforms/MacOSX.platform/Developer/usr/lib" \
"$block"; then
echo "::error::$(basename "$block") does not compile with default isolation $isolation"
failed=1
fi
done
done
exit $failed
shell: /bin/bash -e {0}
env:
BLOCKS: .build/blocks
MD_APPLE_SDK_ROOT: /Applications/Xcode.app
Format lint every block with lints/.swift-format
▸ Run swift format lint --strict --configuration lints/.swift-format \
swift format lint --strict --configuration lints/.swift-format \
"$BLOCKS"/*.swift "$BLOCKS"/diffs/*.swift .github/examples/*/Sources/*/*.swift
shell: /bin/bash -e {0}
env:
BLOCKS: .build/blocks
MD_APPLE_SDK_ROOT: /Applications/Xcode.app
Post Run actions/checkout@v5
Post job cleanup.
[command]/usr/bin/git version
git version 2.54.0 (Apple Git-157)
Copying '/Users/bsa/.gitconfig' to '/Users/bsa/.local/share/github-runner-xpd/_work/_temp/8f550abc-1298-473c-a619-f16df9084720/.gitconfig'
Temporarily overriding HOME='/Users/bsa/.local/share/github-runner-xpd/_work/_temp/8f550abc-1298-473c-a619-f16df9084720' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /Users/bsa/.local/share/github-runner-xpd/_work/modern-swift/modern-swift
[command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
[command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/git\.cafe\/\.extraheader
http.https://git.cafe/.extraheader
[command]/usr/bin/git config --local --unset-all http.https://git.cafe/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/git\.cafe\/\.extraheader' && git config --local --unset-all 'http.https://git.cafe/.extraheader' || :"
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Complete job
Cleaning up orphan processes