feat: Complete System Extension bundle implementation with actual IOKit USB device claiming #43
Workflow file for this run
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: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| run_tests: | |
| description: 'Run Unit Tests' | |
| required: false | |
| default: false | |
| type: boolean | |
| run_integration_tests: | |
| description: 'Run Integration Tests (QEMU)' | |
| required: false | |
| default: false | |
| type: boolean | |
| env: | |
| # Global environment variables for consistent status reporting | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| lint: | |
| name: Code Quality (SwiftLint) | |
| runs-on: macos-latest | |
| steps: | |
| - name: π Starting Code Quality Check | |
| run: | | |
| echo "::notice title=Code Quality Check::Starting SwiftLint validation for code quality and style compliance" | |
| echo "π This check validates Swift code against project style guidelines" | |
| echo "π Status: STARTING" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache SwiftLint | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| /usr/local/bin/swiftlint | |
| /opt/homebrew/bin/swiftlint | |
| key: ${{ runner.os }}-swiftlint-${{ hashFiles('.swiftlint.yml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swiftlint- | |
| - name: π§ Install SwiftLint | |
| run: | | |
| echo "::group::SwiftLint Installation" | |
| echo "π¦ Checking SwiftLint installation status..." | |
| # Check if SwiftLint is already installed | |
| if ! command -v swiftlint &> /dev/null; then | |
| echo "::notice title=SwiftLint Installation::Installing SwiftLint via Homebrew" | |
| echo "β¬οΈ SwiftLint not found, installing via Homebrew..." | |
| brew install swiftlint | |
| echo "β SwiftLint installation completed" | |
| else | |
| echo "::notice title=SwiftLint Found::Using cached SwiftLint installation" | |
| echo "β SwiftLint is already installed" | |
| echo "π Version: $(swiftlint version)" | |
| fi | |
| echo "::endgroup::" | |
| - name: π Run SwiftLint Analysis | |
| run: | | |
| echo "::group::SwiftLint Analysis" | |
| echo "::notice title=Code Analysis::Running SwiftLint with strict validation" | |
| echo "π Analyzing Swift code for style violations..." | |
| echo "π Status: RUNNING" | |
| echo "βοΈ Configuration: Using .swiftlint.yml rules" | |
| echo "π― Mode: Strict (warnings treated as errors)" | |
| # Use --strict to fail on warnings, --reporter xcode for detailed output | |
| if swiftlint lint --strict --reporter xcode; then | |
| echo "::notice title=SwiftLint Success::No code style violations found" | |
| echo "β Code quality check PASSED" | |
| echo "π Status: SUCCESS" | |
| else | |
| echo "::error title=SwiftLint Violations::Code style violations detected" | |
| echo "β Code quality check FAILED" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| continue-on-error: false | |
| - name: π Code Quality Summary | |
| if: always() | |
| run: | | |
| echo "::group::Code Quality Check Summary" | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "::notice title=Code Quality Complete::All code quality checks passed successfully" | |
| echo "β SwiftLint validation: PASSED" | |
| echo "π No style violations found" | |
| echo "π― Code meets project quality standards" | |
| else | |
| echo "::error title=Code Quality Failed::Code quality checks failed" | |
| echo "β SwiftLint validation: FAILED" | |
| echo "π Style violations detected - see details above" | |
| echo "π§ Action required: Fix code style issues before merging" | |
| fi | |
| echo "::endgroup::" | |
| build: | |
| name: Build Validation | |
| runs-on: macos-latest | |
| steps: | |
| - name: ποΈ Starting Build Validation | |
| run: | | |
| echo "::notice title=Build Validation::Starting project compilation and build validation" | |
| echo "π¨ This check validates that the project compiles successfully" | |
| echo "π Status: STARTING" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π Verify Build Environment | |
| run: | | |
| echo "::group::Build Environment Information" | |
| echo "::notice title=Environment Setup::Verifying Swift and macOS environment" | |
| echo "π§ Swift version: $(swift --version | head -n1)" | |
| echo "π₯οΈ macOS runner: $(sw_vers -productName) $(sw_vers -productVersion)" | |
| echo "π Environment status: READY" | |
| echo "::endgroup::" | |
| - name: Cache Swift packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| .build | |
| ~/Library/Caches/org.swift.swiftpm | |
| ~/Library/org.swift.swiftpm | |
| key: ${{ runner.os }}-swift-${{ hashFiles('Package.swift', 'Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swift- | |
| - name: π¦ Resolve Dependencies | |
| run: | | |
| echo "::group::Dependency Resolution" | |
| echo "::notice title=Dependencies::Resolving Swift package dependencies" | |
| echo "π¦ Resolving Swift package dependencies..." | |
| echo "π Status: RESOLVING" | |
| if swift package resolve; then | |
| echo "::notice title=Dependencies Success::All dependencies resolved successfully" | |
| echo "β Dependencies resolved successfully" | |
| echo "π Status: RESOLVED" | |
| else | |
| echo "::error title=Dependencies Failed::Failed to resolve package dependencies" | |
| echo "β Dependency resolution failed" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| - name: π¨ Build Project | |
| run: | | |
| echo "::group::Project Compilation" | |
| echo "::notice title=Build Process::Compiling project with Swift Package Manager" | |
| echo "π¨ Building project with Swift Package Manager..." | |
| echo "π Status: BUILDING" | |
| echo "βοΈ Build mode: Debug with verbose output" | |
| # Build with verbose output to capture detailed error information | |
| if swift build --verbose; then | |
| echo "::notice title=Build Success::Project compiled successfully" | |
| echo "β Build completed successfully" | |
| echo "π Status: SUCCESS" | |
| echo "π― All Swift modules compiled without errors" | |
| else | |
| echo "::error title=Build Failed::Project compilation failed" | |
| echo "β Build failed - see detailed error information above" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| continue-on-error: false | |
| - name: π Build Validation Summary | |
| if: always() | |
| run: | | |
| echo "::group::Build Validation Summary" | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "::notice title=Build Complete::Build validation completed successfully" | |
| echo "β Project compilation: PASSED" | |
| echo "β Dependency resolution: PASSED" | |
| echo "π― All Swift modules built successfully" | |
| echo "π Build artifacts ready for testing" | |
| else | |
| echo "::error title=Build Failed::Build validation failed" | |
| echo "β Project compilation: FAILED" | |
| echo "π§ Action required: Fix build errors before merging" | |
| echo "π Common build issues to check:" | |
| echo " β’ Missing or incompatible dependencies" | |
| echo " β’ Swift syntax or compilation errors" | |
| echo " β’ Import resolution failures" | |
| echo " β’ Platform compatibility issues" | |
| echo " β’ Package.swift configuration problems" | |
| fi | |
| echo "::endgroup::" | |
| test: | |
| name: Unit Tests | |
| runs-on: macos-latest | |
| if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_tests == 'true' | |
| steps: | |
| - name: π§ͺ Starting Unit Test Execution | |
| run: | | |
| echo "::notice title=Unit Tests::Starting comprehensive unit test execution" | |
| echo "π§ͺ This check validates functionality through automated unit tests" | |
| echo "π Status: STARTING" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π Verify Test Environment | |
| run: | | |
| echo "::group::Test Environment Information" | |
| echo "::notice title=Test Environment::Verifying Swift and macOS test environment" | |
| echo "π§ Swift version: $(swift --version | head -n1)" | |
| echo "π₯οΈ macOS runner: $(sw_vers -productName) $(sw_vers -productVersion)" | |
| echo "π Test environment status: READY" | |
| echo "::endgroup::" | |
| - name: Cache Swift packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| .build | |
| ~/Library/Caches/org.swift.swiftpm | |
| ~/Library/org.swift.swiftpm | |
| key: ${{ runner.os }}-swift-${{ hashFiles('Package.swift', 'Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swift- | |
| - name: π¦ Resolve Test Dependencies | |
| run: | | |
| echo "::group::Test Dependency Resolution" | |
| echo "::notice title=Test Dependencies::Resolving dependencies for test execution" | |
| echo "π¦ Resolving Swift package dependencies for testing..." | |
| echo "π Status: RESOLVING" | |
| if swift package resolve; then | |
| echo "::notice title=Dependencies Success::Test dependencies resolved successfully" | |
| echo "β Dependencies resolved successfully" | |
| echo "π Status: RESOLVED" | |
| else | |
| echo "::error title=Dependencies Failed::Failed to resolve test dependencies" | |
| echo "β Test dependency resolution failed" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| - name: π§ͺ Execute Unit Tests | |
| run: | | |
| echo "::group::Unit Test Execution" | |
| echo "::notice title=Test Execution::Running comprehensive unit test suite" | |
| echo "π§ͺ Running unit tests with Swift Package Manager..." | |
| echo "π Status: TESTING" | |
| echo "βοΈ Test mode: Parallel execution with verbose output" | |
| echo "π― Test suites to execute:" | |
| echo " β’ USBIPDCoreTests - Core functionality validation" | |
| echo " β’ USBIPDCLITests - Command-line interface validation" | |
| # Run tests with verbose output and proper error reporting | |
| if swift test --verbose --parallel; then | |
| echo "::notice title=Tests Success::All unit tests passed successfully" | |
| echo "β Unit tests completed successfully" | |
| echo "π Status: SUCCESS" | |
| else | |
| echo "::error title=Tests Failed::Unit test execution failed" | |
| echo "β Unit tests failed - see detailed failure information above" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| continue-on-error: false | |
| - name: π Unit Test Summary | |
| if: always() | |
| run: | | |
| echo "::group::Unit Test Execution Summary" | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "::notice title=Tests Complete::Unit test execution completed successfully" | |
| echo "β All unit tests: PASSED" | |
| echo "π― Test suites executed successfully:" | |
| echo " β’ USBIPDCoreTests - Core functionality validation" | |
| echo " β’ USBIPDCLITests - Command-line interface validation" | |
| echo "π All functionality validated through automated tests" | |
| else | |
| echo "::error title=Tests Failed::Unit test execution failed" | |
| echo "β Unit test execution: FAILED" | |
| echo "π§ Action required: Fix failing tests before merging" | |
| echo "π Common test failure causes:" | |
| echo " β’ Assertion failures in test cases" | |
| echo " β’ Runtime errors during test execution" | |
| echo " β’ Missing test dependencies or setup" | |
| echo " β’ Platform-specific test compatibility issues" | |
| echo " β’ Test data or mock configuration problems" | |
| fi | |
| echo "::endgroup::" | |
| integration-test: | |
| name: Integration Tests (QEMU) | |
| runs-on: macos-latest | |
| if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_integration_tests == 'true' | |
| steps: | |
| - name: π Starting Integration Test Execution | |
| run: | | |
| echo "::notice title=Integration Tests::Starting end-to-end integration test validation" | |
| echo "π This check validates complete system functionality with QEMU test server" | |
| echo "π Status: STARTING" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π Verify Integration Test Environment | |
| run: | | |
| echo "::group::Integration Test Environment Information" | |
| echo "::notice title=Integration Environment::Verifying Swift and macOS integration test environment" | |
| echo "π§ Swift version: $(swift --version | head -n1)" | |
| echo "π₯οΈ macOS runner: $(sw_vers -productName) $(sw_vers -productVersion)" | |
| echo "π Integration test environment status: READY" | |
| echo "::endgroup::" | |
| - name: Cache Swift packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| .build | |
| ~/Library/Caches/org.swift.swiftpm | |
| ~/Library/org.swift.swiftpm | |
| key: ${{ runner.os }}-swift-${{ hashFiles('Package.swift', 'Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swift- | |
| - name: π§ Setup Integration Test Dependencies | |
| run: | | |
| echo "::group::Integration Test Setup" | |
| echo "::notice title=Test Setup::Configuring integration test dependencies" | |
| echo "π§ Setting up integration test dependencies..." | |
| echo "π Status: CONFIGURING" | |
| # Ensure Scripts directory is executable | |
| chmod +x Scripts/run-qemu-tests.sh | |
| echo "β Test script permissions configured" | |
| echo "π Status: CONFIGURED" | |
| echo "::endgroup::" | |
| - name: π¦ Resolve Integration Dependencies | |
| run: | | |
| echo "::group::Integration Dependency Resolution" | |
| echo "::notice title=Integration Dependencies::Resolving dependencies for integration testing" | |
| echo "π¦ Resolving Swift package dependencies for integration testing..." | |
| echo "π Status: RESOLVING" | |
| if swift package resolve; then | |
| echo "::notice title=Dependencies Success::Integration dependencies resolved successfully" | |
| echo "β Dependencies resolved successfully" | |
| echo "π Status: RESOLVED" | |
| else | |
| echo "::error title=Dependencies Failed::Failed to resolve integration dependencies" | |
| echo "β Integration dependency resolution failed" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| - name: ποΈ Build QEMU Test Server | |
| run: | | |
| echo "::group::QEMU Test Server Build" | |
| echo "::notice title=QEMU Build::Building QEMU test server for integration testing" | |
| echo "ποΈ Building QEMU test server..." | |
| echo "π Status: BUILDING" | |
| if swift build --product QEMUTestServer; then | |
| echo "::notice title=QEMU Build Success::QEMU test server built successfully" | |
| echo "β QEMU test server built successfully" | |
| echo "π Status: BUILT" | |
| else | |
| echo "::error title=QEMU Build Failed::Failed to build QEMU test server" | |
| echo "β QEMU test server build failed" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| - name: π§ͺ Run QEMU Test Script Validation | |
| run: | | |
| echo "::group::QEMU Script Validation" | |
| echo "::notice title=QEMU Validation::Running QEMU test server validation script" | |
| echo "π§ͺ Running QEMU test server validation script..." | |
| echo "π Status: VALIDATING" | |
| if ./Scripts/run-qemu-tests.sh; then | |
| echo "::notice title=QEMU Validation Success::QEMU test script validation completed successfully" | |
| echo "β QEMU test script validation completed" | |
| echo "π Status: VALIDATED" | |
| else | |
| echo "::error title=QEMU Validation Failed::QEMU test script validation failed" | |
| echo "β QEMU test script validation failed" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| continue-on-error: false | |
| - name: π Execute Integration Tests | |
| run: | | |
| echo "::group::Integration Test Execution" | |
| echo "::notice title=Integration Execution::Running end-to-end integration tests" | |
| echo "π Running integration tests with QEMU test server..." | |
| echo "π Status: TESTING" | |
| echo "βοΈ Test mode: Integration tests with verbose output" | |
| echo "π― Integration test components:" | |
| echo " β’ QEMU test server functionality" | |
| echo " β’ End-to-end protocol flow validation" | |
| echo " β’ Network communication layer testing" | |
| # Run only the integration tests | |
| if swift test --filter IntegrationTests --verbose; then | |
| echo "::notice title=Integration Success::Integration tests completed successfully" | |
| echo "β Integration tests completed successfully" | |
| echo "π Status: SUCCESS" | |
| else | |
| echo "::error title=Integration Failed::Integration test execution failed" | |
| echo "β Integration tests failed - see detailed failure information above" | |
| echo "π Status: FAILED" | |
| exit 1 | |
| fi | |
| echo "::endgroup::" | |
| continue-on-error: false | |
| - name: π Integration Test Summary | |
| if: always() | |
| run: | | |
| echo "::group::Integration Test Execution Summary" | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "::notice title=Integration Complete::Integration test execution completed successfully" | |
| echo "β All integration tests: PASSED" | |
| echo "β QEMU test server: VALIDATED" | |
| echo "π― Integration test components validated:" | |
| echo " β’ QEMU test server functionality" | |
| echo " β’ End-to-end protocol flow validation" | |
| echo " β’ Network communication layer testing" | |
| echo " β’ System integration and compatibility" | |
| echo "π Complete system functionality validated" | |
| else | |
| echo "::error title=Integration Failed::Integration test execution failed" | |
| echo "β Integration test execution: FAILED" | |
| echo "π§ Action required: Fix integration issues before merging" | |
| echo "π Common integration test failure causes:" | |
| echo " β’ QEMU test server setup or configuration issues" | |
| echo " β’ Network connectivity or communication problems" | |
| echo " β’ USB/IP protocol compatibility issues" | |
| echo " β’ Test environment configuration problems" | |
| echo " β’ System-level integration failures" | |
| echo " β’ Resource availability or timing issues" | |
| fi | |
| echo "::endgroup::" |