feat: add DocC documentation, comprehensive tests, and cross-platform CI #69
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: swift | |
| on: | |
| push: | |
| branches: [main, master, develop] | |
| pull_request: | |
| branches: [main, master, develop] | |
| jobs: | |
| # Build and test on multiple platforms | |
| build-and-test: | |
| name: Swift ${{ matrix.swift }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| swift: ["6.0.0"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Swift | |
| uses: SwiftyLab/setup-swift@v1 | |
| with: | |
| swift-version: ${{ matrix.swift }} | |
| # Rust is needed to build the FFI library on all platforms | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.82.0" | |
| # Build Rust FFI library (Linux) | |
| - name: Build Rust FFI (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| chmod +x ./scripts/build_linux.sh | |
| ./scripts/build_linux.sh | |
| # Build Rust FFI library (Windows) | |
| - name: Build Rust FFI (Windows) | |
| if: runner.os == 'Windows' | |
| run: .\scripts\build_windows.ps1 | |
| shell: pwsh | |
| # Build Rust FFI library (macOS) - builds local xcframework | |
| - name: Build Rust FFI (macOS) | |
| if: runner.os == 'macOS' | |
| run: ./scripts/build_macos.sh | |
| - name: Build | |
| run: swift build -c release | |
| env: | |
| LOCAL_BUILD: ${{ runner.os == 'macOS' && 'true' || '' }} | |
| - name: Run tests | |
| run: swift test | |
| env: | |
| LOCAL_BUILD: ${{ runner.os == 'macOS' && 'true' || '' }} |