Modify CI workflow for test coverage and reporting #2
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
| # This workflow will build a Swift project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift | |
| name: XcodeTargets Unit Tests | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: SwiftyLab/setup-swift@latest | |
| - name: Build | |
| run: swift build | |
| - name: Run tests with coverage | |
| run: swift test --enable-code-coverage | |
| - name: Generate coverage report (lcov) | |
| run: swift package generate-coverage-data --output-path info.lcov | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: michaelversus/XcodeTargets | |
| files: info.lcov | |
| fail_ci_if_error: true | |
| verbose: true |