fix(ci): make ShellCommand output capture Swift 6 concurrency-safe on… #86
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| jobs: | |
| macos-baseline: | |
| name: Baseline (macOS 14 / Swift 6) | |
| runs-on: macos-14 | |
| if: ${{ github.event_name != 'pull_request' || github.base_ref == 'main' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Select latest Xcode | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| XCODE_PATH="$(ls -1d /Applications/Xcode*.app 2>/dev/null | sort -V | tail -n 1)" | |
| if [[ -z "${XCODE_PATH:-}" ]]; then | |
| echo "No Xcode installation found on runner." >&2 | |
| exit 1 | |
| fi | |
| sudo xcode-select -s "$XCODE_PATH/Contents/Developer" | |
| xcodebuild -version | |
| - name: Verify Swift 6 toolchain | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| swift --version | |
| if ! swift --version | grep -E "Swift version 6\\." >/dev/null; then | |
| echo "Swift 6.x is required for baseline CI." >&2 | |
| exit 1 | |
| fi | |
| - name: Build and test packages | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cd OrchivisteAPI | |
| swift build -c debug --product OrchivisteAPI | |
| swift test | |
| cd ../OrchivisteAnalyse | |
| swift build -c debug --product OrchivisteAnalyse | |
| cd ../OrchivisteWorker | |
| swift build -c debug --product OrchivisteWorker | |
| - name: Run baseline smokes | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| chmod +x scripts/smoke_analyse_semantic.sh scripts/smoke_webhook_hmac.sh scripts/smoke_cockpit_v1.sh | |
| ./scripts/smoke_analyse_semantic.sh | |
| ./scripts/smoke_webhook_hmac.sh | |
| ./scripts/smoke_cockpit_v1.sh | |
| linux-docker-compat: | |
| name: Docker compatibility (Linux) | |
| runs-on: ubuntu-22.04 | |
| if: ${{ github.event_name != 'pull_request' || github.base_ref == 'main' }} | |
| services: | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Swift | |
| uses: swift-actions/setup-swift@v2 | |
| with: | |
| swift-version: "6.0" | |
| - name: Build and test packages | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cd OrchivisteAPI | |
| swift test | |
| cd ../OrchivisteAnalyse | |
| swift build | |
| cd ../OrchivisteWorker | |
| swift build | |
| - name: Validate Compose files | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| docker compose config | |
| docker compose --profile worker config | |
| - name: Analyse semantic regression | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| chmod +x scripts/smoke_analyse_semantic.sh scripts/smoke_regression_dataset.sh | |
| ./scripts/smoke_analyse_semantic.sh | |
| ./scripts/smoke_regression_dataset.sh | |
| - name: MVP smoke test | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| chmod +x scripts/smoke_mvp.sh | |
| ./OrchivisteAnalyse/.build/debug/OrchivisteAnalyse > /tmp/orchiviste-analyse.log 2>&1 & | |
| ANALYSE_PID=$! | |
| ORCHIVISTE_API_HOST=127.0.0.1 \ | |
| ORCHIVISTE_API_PORT=28780 \ | |
| ORCHIVISTE_SQLITE_PATH=/tmp/orchiviste-ci.sqlite \ | |
| ORCHIVISTE_AUTO_MIGRATE=1 \ | |
| ORCHIVISTE_REDIS_URL=redis://127.0.0.1:6379 \ | |
| ORCHIVISTE_ANALYSE_URL=http://127.0.0.1:28781 \ | |
| ./OrchivisteAPI/.build/debug/OrchivisteAPI > /tmp/orchiviste-api.log 2>&1 & | |
| API_PID=$! | |
| cleanup() { | |
| kill "$API_PID" >/dev/null 2>&1 || true | |
| kill "$ANALYSE_PID" >/dev/null 2>&1 || true | |
| } | |
| trap cleanup EXIT | |
| for _ in $(seq 1 60); do | |
| if curl -sSf http://127.0.0.1:28780/v1/health >/dev/null; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| ./scripts/smoke_mvp.sh | |
| - name: Webhook HMAC smoke test | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| chmod +x scripts/smoke_webhook_hmac.sh | |
| ./scripts/smoke_webhook_hmac.sh |