Compare commits

...

4 Commits

Author SHA1 Message Date
Peter Steinberger
1362586cd4 Fix CI: Use macos-latest and check for more Xcode versions
- Switch to macos-latest runner for better Xcode availability
- Check for Xcode 16.2, 16.1, 16.0, 15.4, 15.3, 15.2 (all have Swift 6.0+)
- Previous CI failed because default Xcode only had Swift 5.10

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 22:36:48 +01:00
Peter Steinberger
203091f3cf Trigger CI run 2025-06-08 22:29:22 +01:00
Peter Steinberger
46f19a8bf2 Improve Xcode version selection logic
- Check for Xcode 16.4, then 16.3, then fall back to default Xcode.app
- Remove hardcoded DEVELOPER_DIR environment variable
- Export selected DEVELOPER_DIR for subsequent steps
- Add clear logging to show which Xcode version is being used

This makes the CI more flexible and able to work with different
GitHub Actions runner configurations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 22:20:01 +01:00
Peter Steinberger
2e5e973d9d Improve CI workflow reliability and performance
- Switch from macOS-15 to macOS-14 runners for better availability
- Add caching for Swift build artifacts to speed up builds
- Add fallback logic for Xcode version selection
- Set appropriate timeouts for test runs
- Configure log levels to reduce noise in CI
- Cache both Swift build directory and compiled binary

These changes should:
- Reduce CI wait times by using more available runners
- Speed up builds with cached Swift artifacts
- Handle different Xcode versions gracefully
- Prevent timeout issues during test runs

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 21:49:03 +01:00

View File

@ -8,24 +8,61 @@ on:
jobs:
test:
runs-on: macos-15
runs-on: macos-latest
strategy:
matrix:
node-version: [20.x, 22.x]
env:
DEVELOPER_DIR: /Applications/Xcode_16.3.app/Contents/Developer
# Xcode will be selected dynamically in the setup step
steps:
- uses: actions/checkout@v4
- name: Set up Xcode
run: |
sudo xcode-select -s $DEVELOPER_DIR
# Try to find the best available Xcode version with Swift 6.0+
if [ -d "/Applications/Xcode_16.2.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_16.2.app/Contents/Developer"
echo "Using Xcode 16.2"
elif [ -d "/Applications/Xcode_16.1.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_16.1.app/Contents/Developer"
echo "Using Xcode 16.1"
elif [ -d "/Applications/Xcode_16.0.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_16.0.app/Contents/Developer"
echo "Using Xcode 16.0"
elif [ -d "/Applications/Xcode_15.4.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_15.4.app/Contents/Developer"
echo "Using Xcode 15.4"
elif [ -d "/Applications/Xcode_15.3.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_15.3.app/Contents/Developer"
echo "Using Xcode 15.3"
elif [ -d "/Applications/Xcode_15.2.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_15.2.app/Contents/Developer"
echo "Using Xcode 15.2"
elif [ -d "/Applications/Xcode.app" ]; then
DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
echo "Using default Xcode"
else
echo "Error: No Xcode installation found"
exit 1
fi
sudo xcode-select -s "$DEVELOPER_DIR"
echo "DEVELOPER_DIR=$DEVELOPER_DIR" >> $GITHUB_ENV
xcodebuild -version
swift --version
- name: Cache Swift build
uses: actions/cache@v4
with:
path: |
peekaboo-cli/.build
peekaboo
key: ${{ runner.os }}-swift-${{ hashFiles('peekaboo-cli/Package.swift', 'peekaboo-cli/Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-
- name: Build Swift CLI for tests
run: |
cd peekaboo-cli
@ -55,8 +92,10 @@ jobs:
- name: Run tests with coverage
run: npm run test:coverage
timeout-minutes: 15
env:
CI: true
PEEKABOO_LOG_LEVEL: warn
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
@ -68,21 +107,56 @@ jobs:
fail_ci_if_error: false
build-swift:
runs-on: macos-15
runs-on: macos-latest
timeout-minutes: 30
env:
DEVELOPER_DIR: /Applications/Xcode_16.3.app/Contents/Developer
# Xcode will be selected dynamically in the setup step
steps:
- uses: actions/checkout@v4
- name: Set up Xcode
run: |
sudo xcode-select -s $DEVELOPER_DIR
# Try to find the best available Xcode version with Swift 6.0+
if [ -d "/Applications/Xcode_16.2.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_16.2.app/Contents/Developer"
echo "Using Xcode 16.2"
elif [ -d "/Applications/Xcode_16.1.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_16.1.app/Contents/Developer"
echo "Using Xcode 16.1"
elif [ -d "/Applications/Xcode_16.0.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_16.0.app/Contents/Developer"
echo "Using Xcode 16.0"
elif [ -d "/Applications/Xcode_15.4.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_15.4.app/Contents/Developer"
echo "Using Xcode 15.4"
elif [ -d "/Applications/Xcode_15.3.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_15.3.app/Contents/Developer"
echo "Using Xcode 15.3"
elif [ -d "/Applications/Xcode_15.2.app" ]; then
DEVELOPER_DIR="/Applications/Xcode_15.2.app/Contents/Developer"
echo "Using Xcode 15.2"
elif [ -d "/Applications/Xcode.app" ]; then
DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
echo "Using default Xcode"
else
echo "Error: No Xcode installation found"
exit 1
fi
sudo xcode-select -s "$DEVELOPER_DIR"
echo "DEVELOPER_DIR=$DEVELOPER_DIR" >> $GITHUB_ENV
xcodebuild -version
swift --version
- name: Cache Swift build artifacts
uses: actions/cache@v4
with:
path: peekaboo-cli/.build
key: ${{ runner.os }}-swift-build-${{ hashFiles('peekaboo-cli/Package.swift', 'peekaboo-cli/Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-build-
- name: Build Swift CLI
run: |
cd peekaboo-cli