|
18 | 18 | - name: Test |
19 | 19 | uses: actions/checkout@v1 |
20 | 20 | - run: swift test --enable-code-coverage |
21 | | - - uses: ./.github/actions/lcov |
| 21 | + - uses: michaelhenry/swifty-code-coverage@v1.0.0 |
22 | 22 | with: |
23 | 23 | build-path: .build |
24 | 24 | target: GithubChecksPackageTests.xctest |
|
39 | 39 | runs-on: macos-latest |
40 | 40 | steps: |
41 | 41 | - uses: actions/checkout@v1 |
42 | | - - run: xcodebuild test -project App.xcodeproj -scheme App -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=13.0' -enableCodeCoverage YES |
| 42 | + - run: xcodebuild test -project App.xcodeproj -scheme App -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=13.0' -enableCodeCoverage YES -derivedDataPath DerivedData |
43 | 43 | - uses: michaelhenry/swifty-code-coverage@v1.0.0 |
44 | 44 | with: |
45 | 45 | build-path: DerivedData |
|
55 | 55 | ``` |
56 | 56 |
|
57 | 57 | > For some reason even though the code-coverage was generate from the same llvm version, codeclimate is returning an error " ./cc-test-reporter: cannot execute binary file: Exec format error" when using an ubuntu machine. |
| 58 | +
|
| 59 | +## Note |
| 60 | +
|
| 61 | +If your project is an SPM project, please use the `.xctest` file as `target` which was generated from `swift test --enable-code-coverage` and set the `is-spm` to `true`. |
| 62 | + |
| 63 | +Eg. |
| 64 | + |
| 65 | +```yml |
| 66 | + - run: swift test --enable-code-coverage |
| 67 | + - uses: michaelhenry/swifty-code-coverage@v1.0.0 |
| 68 | + with: |
| 69 | + build-path: .build |
| 70 | + target: AppTests.xctest |
| 71 | + is-spm: true |
| 72 | +``` |
| 73 | + |
| 74 | +Otherwise, if your project is an ios/macos that uses the `xcodebuild test` to test, please use the `.app` as `target` which was the file generated from the `xcodebuild test -enableCodeCoverage YES` and set the `is-spm` to `false`. |
| 75 | + |
| 76 | +Eg. |
| 77 | + |
| 78 | +```yml |
| 79 | + - run: xcodebuild test -project App.xcodeproj -scheme App -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=13.0' -enableCodeCoverage YES -derivedDataPath DerivedData |
| 80 | + - uses: michaelhenry/swifty-code-coverage@v1.0.0 |
| 81 | + with: |
| 82 | + build-path: DerivedData |
| 83 | + target: App.app |
| 84 | + is-spm: false |
| 85 | +``` |
0 commit comments