mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-31 22:18:12 +08:00
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
name: Reproduce SwiftLint Crash (0.59.0)
|
|
|
|
on:
|
|
workflow_dispatch: # manual trigger
|
|
|
|
jobs:
|
|
swiftlint-crash-test:
|
|
runs-on: macos-15
|
|
name: SwiftLint 0.59.0 Crash Check on macOS 15
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup test files with invalid .swiftlint.yml
|
|
run: |
|
|
mkdir -p subdir
|
|
echo -e "opt_in_rules:\n - closure_body_length\n\nopt_in_rules:\n - closure_body_length" > subdir/.swiftlint.yml
|
|
echo "let a = 1" > subdir/a.swift
|
|
|
|
- name: Install dependencies
|
|
run: brew install swift
|
|
|
|
- name: Build SwiftLint 0.59.0 from source
|
|
run: |
|
|
git clone https://github.com/realm/SwiftLint.git
|
|
cd SwiftLint
|
|
git checkout 0.59.0
|
|
swift build -c release
|
|
sudo cp .build/release/swiftlint /usr/local/bin/swiftlint
|
|
|
|
- name: Print SwiftLint Version
|
|
run: swiftlint --version
|
|
|
|
- name: Run SwiftLint with crash detection
|
|
run: |
|
|
echo "🧪 Running SwiftLint..."
|
|
cd subdir
|
|
set +e
|
|
swiftlint > ../swiftlint-output.txt 2>&1
|
|
EXIT_CODE=$?
|
|
cat ../swiftlint-output.txt
|
|
|
|
echo "::group::🔍 SwiftLint Result Analysis"
|
|
if grep -q "Could not read configuration" ../swiftlint-output.txt; then
|
|
echo "::error ::💥 SwiftLint crashed due to malformed config"
|
|
echo "Crash detected in SwiftLint 0.59.0"
|
|
elif [ $EXIT_CODE -ne 0 ]; then
|
|
echo "::warning ::⚠️ SwiftLint exited with lint violations"
|
|
else
|
|
echo "✅ SwiftLint ran successfully without crash or violations"
|
|
fi
|
|
echo "::endgroup::"
|