Add comprehensive README with usage examples and documentation #21
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: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| branches: | |
| - '*' | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| macos-15: | |
| name: macOS 15 | |
| runs-on: macos-15 | |
| strategy: | |
| matrix: | |
| xcode: | |
| - '16.3' | |
| package: | |
| - 'main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode ${{ matrix.xcode }} | |
| run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app | |
| - name: Print Swift version | |
| run: swift --version | |
| - name: Build package | |
| run: swift build | |
| - name: Run tests | |
| run: swift test | |
| linux: | |
| name: Ubuntu - ${{ matrix.package }} (Swift ${{ matrix.swift }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| swift: | |
| - '6.1' | |
| package: | |
| - 'main' | |
| container: swift:${{ matrix.swift }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build package | |
| run: swift build | |
| - name: Run tests | |
| run: swift test | |
| windows: | |
| name: Windows - ${{ matrix.package }} (Swift ${{ matrix.swift }}) | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| swift: | |
| - '6.1' | |
| package: | |
| - 'main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Swift | |
| uses: compnerd/gha-setup-swift@main | |
| with: | |
| branch: swift-${{ matrix.swift }}-release | |
| tag: ${{ matrix.swift }}-RELEASE | |
| - name: Build package | |
| run: swift build | |
| # Looks like tests don't work on Windows | |
| # - name: Run tests | |
| # run: swift test | |
| # code-coverage: | |
| # name: Gather Code Coverage | |
| # needs: macos | |
| # runs-on: macos-14 | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v4 | |
| # - name: Select latest Xcode | |
| # run: sudo xcode-select -s /Applications/Xcode_15.4.app | |
| # - name: Build and test with coverage | |
| # run: swift test -Xswiftc -Xfrontend -Xswiftc -dump-macro-expansions --enable-code-coverage | |
| # - name: Gather code coverage | |
| # run: | | |
| # BUILD_PATH=$(swift build --show-bin-path) | |
| # xcrun llvm-cov report \ | |
| # $BUILD_PATH/swift-spyablePackageTests.xctest/Contents/MacOS/swift-spyablePackageTests \ | |
| # -instr-profile=$BUILD_PATH/codecov/default.profdata \ | |
| # -ignore-filename-regex=".build|Tests" -use-color | |
| # xcrun llvm-cov export -format="lcov" \ | |
| # $BUILD_PATH/swift-spyablePackageTests.xctest/Contents/MacOS/swift-spyablePackageTests \ | |
| # -instr-profile=$BUILD_PATH/codecov/default.profdata \ | |
| # -ignore-filename-regex=".build|Tests" > coverage_report.lcov | |
| # - name: Upload coverage reports to Codecov | |
| # uses: codecov/codecov-action@v4 | |
| # with: | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| # files: ./coverage_report.lcov | |
| # check-macro-compatibility: | |
| # name: Check Macro Compatibility | |
| # runs-on: macos-latest | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v4 | |
| # - name: Run Swift Macro Compatibility Check | |
| # uses: Matejkob/swift-macro-compatibility-check@v1 | |
| # with: | |
| # run-tests: true | |
| # major-versions-only: true | |