Skip to main content
Notice removed Draw attention by JShoe
Bounty Ended with Thomas Hu's answer chosen by JShoe
Updated title for clarity
Source Link
JShoe
  • 75
  • 8

How do I integrate Unity and CodeCov (Using GitHub Actions)?

CodeCov ErrorError

Run codecov/codecov-action@v2
  with:
    name: CodeCov
    flags: automated
    token: ***
    files: coverage-results/**/*.xml
  env:
    UNITY_LICENSE: ***
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (330066ecce62f2cdcfd2fe1845095475f51bbad9649dce81ac7b663dc884bbef  codecov)
==> Running version latest
==> Running version v0.1.15
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n CodeCov -Q github-action-2.1.0 -f coverage-results/**/*.xml -F automated -C 9d9656791bb5e390945821f1ecaae8a226b15aba
[2022-01-27T20:19:24.095Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.15
[2022-01-27T20:19:24.108Z] ['info'] => Project root located at: /home/runner/work/Time-Bubble/Time-Bubble
[2022-01-27T20:19:24.108Z] ['info'] ->  Token found by environment variables
[2022-01-27T20:19:24.119Z] ['info'] Searching for coverage files...
[2022-01-27T20:19:24.133Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!

How do I integrate Unity and CodeCov?

CodeCov Error

How do I integrate Unity and CodeCov (Using GitHub Actions)?

Error

Run codecov/codecov-action@v2
  with:
    name: CodeCov
    flags: automated
    token: ***
    files: coverage-results/**/*.xml
  env:
    UNITY_LICENSE: ***
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (330066ecce62f2cdcfd2fe1845095475f51bbad9649dce81ac7b663dc884bbef  codecov)
==> Running version latest
==> Running version v0.1.15
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n CodeCov -Q github-action-2.1.0 -f coverage-results/**/*.xml -F automated -C 9d9656791bb5e390945821f1ecaae8a226b15aba
[2022-01-27T20:19:24.095Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.15
[2022-01-27T20:19:24.108Z] ['info'] => Project root located at: /home/runner/work/Time-Bubble/Time-Bubble
[2022-01-27T20:19:24.108Z] ['info'] ->  Token found by environment variables
[2022-01-27T20:19:24.119Z] ['info'] Searching for coverage files...
[2022-01-27T20:19:24.133Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!
Tweeted twitter.com/StackGameDev/status/1486806285123305480
I've encapsulated the test and coverage portion into it's own workflow
Source Link
JShoe
  • 75
  • 8
name: Build

on: 
Test with push:coverage
    brancheson: [master]
  pull_request:
    branches: [master]
    
env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
    
jobs:
 
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          customParameters: -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./coverage-results -coverageOptions generateAdditionalMetrics


      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}
          
  codeCov:
    needs: testRunner
    name: Submit to CodeCov
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Upload XML report to Codecov
        uses: codecov/codecov-action@v2
        with:
          name: CodeCov
          flags: automated
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage-results/**/*.xml
          


  buildWebGL:
    needs: codeCov
    name: Build for WebGL
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-WebGL
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: WebGL

      - uses: actions/upload-artifact@v2
        with:
          name: build-WebGL
          path: build/WebGL

  buildWindows:
    needs: codeCov
    name: Build for Windows
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-StandaloneWindows64
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: StandaloneWindows64

      - uses: actions/upload-artifact@v2
        with:
          name: build-StandaloneWindows64
          path: build/StandaloneWindows64

  buildAndroid:
    needs: codeCov
    name: BuildCheck for Androidfailure
    runs-on: ubuntu-latest
    strategy:
      fail-fastif: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('CodeCov.lfs-assets-id') }}

      - name: Gitoutcome LFS!= Pull'success'
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-Android
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: Android

      - uses: actions/upload-artifact@v2
        with:
          name: build-Android
          path: build/Android


  deployPages:
    needs: buildWebGL
    name: Deploy to Github Pages
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - uses: actions/download-artifact@v2
        with:
          name: build-WebGL
          path: build

      - name: Deploy
        uses:exit JamesIves/github-pages-deploy-action@4.1.4
        with:
          branch: gh-pages
          folder: build/WebGL
name: Build

on: 
  push:
    branches: [master]
  pull_request:
    branches: [master]

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          customParameters: -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./coverage-results -coverageOptions generateAdditionalMetrics


      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}
          
  codeCov:
    needs: testRunner
    name: Submit to CodeCov
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Upload XML report to Codecov
        uses: codecov/codecov-action@v2
        with:
          name: CodeCov
          flags: automated
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage-results/**/*.xml
          


  buildWebGL:
    needs: codeCov
    name: Build for WebGL
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-WebGL
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: WebGL

      - uses: actions/upload-artifact@v2
        with:
          name: build-WebGL
          path: build/WebGL

  buildWindows:
    needs: codeCov
    name: Build for Windows
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-StandaloneWindows64
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: StandaloneWindows64

      - uses: actions/upload-artifact@v2
        with:
          name: build-StandaloneWindows64
          path: build/StandaloneWindows64

  buildAndroid:
    needs: codeCov
    name: Build for Android
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-Android
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: Android

      - uses: actions/upload-artifact@v2
        with:
          name: build-Android
          path: build/Android


  deployPages:
    needs: buildWebGL
    name: Deploy to Github Pages
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - uses: actions/download-artifact@v2
        with:
          name: build-WebGL
          path: build

      - name: Deploy
        uses: JamesIves/github-pages-deploy-action@4.1.4
        with:
          branch: gh-pages
          folder: build/WebGL
name: Test with coverage
on:
  pull_request:
    branches: [master]
    
env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
    
jobs:
 
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          customParameters: -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./coverage-results -coverageOptions generateAdditionalMetrics


      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}
          
  codeCov:
    needs: testRunner
    name: Submit to CodeCov
    runs-on: ubuntu-latest
    steps:
      - name: Upload XML report to Codecov
        uses: codecov/codecov-action@v2
        with:
          name: CodeCov
          flags: automated
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage-results/**/*.xml
          
      - name: Check for failure
        if: steps.CodeCov.outcome != 'success'
        run: exit 1
deleted 7295 characters in body
Source Link
JShoe
  • 75
  • 8

I'm working on a new project using TDD, and I remember on an old project with a friend I used CodeCov, and loved it.

Right now I'm generating coverage reports using Unity's Code Coverage package. I'm not, however, super well-versed in things like random .ymls and build instructions.

What do I have to do in order to send my coverage reports to CodeCov? I see my auth token I have to include, I see my coverage reports when I generate them, I just can't find any simple and entry-level documentation on how to smack the two together.

Edit, Current Update (2):

GitHub actions now attemptsattempt to upload my coverage reports to CodeCov, but I get an error. Below is my most recent GitHub Action code, and the error I'm receiving from CodeCov. Please let me know if there is any more information I camcan provide.

name: Build

on: 
  push:
    branches: [master]
  pull_request:
    branches: [master]

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          customParameters: -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./coverage-results -coverageOptions generateAdditionalMetrics


      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}
          
  codeCov:
    needs: testRunner
    name: Submit to CodeCov
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Upload XML report to Codecov
        uses: codecov/codecov-action@v2
        with:
          name: CodeCov
          flags: automated
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage-results/**/*.xml
          


  buildWebGL:
    needs: codeCov
    name: Build for WebGL
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-WebGL
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: WebGL

      - uses: actions/upload-artifact@v2
        with:
          name: build-WebGL
          path: build/WebGL

  buildWindows:
    needs: codeCov
    name: Build for Windows
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-StandaloneWindows64
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: StandaloneWindows64

      - uses: actions/upload-artifact@v2
        with:
          name: build-StandaloneWindows64
          path: build/StandaloneWindows64

  buildAndroid:
    needs: codeCov
    name: Build for Android
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-Android
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: Android

      - uses: actions/upload-artifact@v2
        with:
          name: build-Android
          path: build/Android


  deployPages:
    needs: buildWebGL
    name: Deploy to Github Pages
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - uses: actions/download-artifact@v2
        with:
          name: build-WebGL
          path: build

      - name: Deploy
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages
          folder: build/WebGL

Edit, Update (old):

I now have Github Actions fully configured to test and build my project. I've included that code below. Just above that is a bit of code that I found that should (I think?) submit my report to codecov. I haven't quite figured out how to put them together, neither had great resources on formatting the .yml correctly.

The Snippet

   - name: Upload XML report to Codecov
     uses: codecov/codecov-action@v2
     with:
       name: PlayMode
       flags: automated
       token: ${{ secrets.CODECOV_TOKEN }}
       files: coverage-results/**/*.xml

My build.yml

name: Build

on: push

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}

  buildWebGL:
    needs: testRunner
    name: Build for WebGL
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-WebGL
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: WebGL

      - uses: actions/upload-artifact@v2
        with:
          name: build-WebGL
          path: build/WebGL

  buildWindows:
    needs: testRunner
    name: Build for Windows
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-StandaloneWindows64
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: StandaloneWindows64

      - uses: actions/upload-artifact@v2
        with:
          name: build-StandaloneWindows64
          path: build/StandaloneWindows64

  buildAndroid:
    needs: testRunner
    name: Build for Android
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-Android
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: Android

      - uses: actions/upload-artifact@v2
        with:
          name: build-Android
          path: build/Android


  deployPages:
    needs: buildWebGL
    name: Deploy to Github Pages
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - uses: actions/download-artifact@v2
        with:
          name: build-WebGL
          path: build

      - name: Deploy
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages
          folder: build/WebGL

I'm working on a new project using TDD, and I remember on an old project with a friend I used CodeCov, and loved it.

Right now I'm generating coverage reports using Unity's Code Coverage package. I'm not, however, super well-versed in things like random .ymls and build instructions.

What do I have to do in order to send my coverage reports to CodeCov? I see my auth token I have to include, I see my coverage reports when I generate them, I just can't find any simple and entry-level documentation on how to smack the two together.

Edit, Current Update (2):

GitHub actions now attempts to upload my coverage reports to CodeCov, but I get an error. Below is my most recent GitHub Action code, and the error I'm receiving from CodeCov. Please let me know if there is any more information I cam provide.

name: Build

on: 
  push:
    branches: [master]
  pull_request:
    branches: [master]

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          customParameters: -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./coverage-results -coverageOptions generateAdditionalMetrics


      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}
          
  codeCov:
    needs: testRunner
    name: Submit to CodeCov
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Upload XML report to Codecov
        uses: codecov/codecov-action@v2
        with:
          name: CodeCov
          flags: automated
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage-results/**/*.xml
          


  buildWebGL:
    needs: codeCov
    name: Build for WebGL
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-WebGL
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: WebGL

      - uses: actions/upload-artifact@v2
        with:
          name: build-WebGL
          path: build/WebGL

  buildWindows:
    needs: codeCov
    name: Build for Windows
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-StandaloneWindows64
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: StandaloneWindows64

      - uses: actions/upload-artifact@v2
        with:
          name: build-StandaloneWindows64
          path: build/StandaloneWindows64

  buildAndroid:
    needs: codeCov
    name: Build for Android
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-Android
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: Android

      - uses: actions/upload-artifact@v2
        with:
          name: build-Android
          path: build/Android


  deployPages:
    needs: buildWebGL
    name: Deploy to Github Pages
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - uses: actions/download-artifact@v2
        with:
          name: build-WebGL
          path: build

      - name: Deploy
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages
          folder: build/WebGL

Edit, Update (old):

I now have Github Actions fully configured to test and build my project. I've included that code below. Just above that is a bit of code that I found that should (I think?) submit my report to codecov. I haven't quite figured out how to put them together, neither had great resources on formatting the .yml correctly.

The Snippet

   - name: Upload XML report to Codecov
     uses: codecov/codecov-action@v2
     with:
       name: PlayMode
       flags: automated
       token: ${{ secrets.CODECOV_TOKEN }}
       files: coverage-results/**/*.xml

My build.yml

name: Build

on: push

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}

  buildWebGL:
    needs: testRunner
    name: Build for WebGL
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-WebGL
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: WebGL

      - uses: actions/upload-artifact@v2
        with:
          name: build-WebGL
          path: build/WebGL

  buildWindows:
    needs: testRunner
    name: Build for Windows
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-StandaloneWindows64
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: StandaloneWindows64

      - uses: actions/upload-artifact@v2
        with:
          name: build-StandaloneWindows64
          path: build/StandaloneWindows64

  buildAndroid:
    needs: testRunner
    name: Build for Android
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-Android
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: Android

      - uses: actions/upload-artifact@v2
        with:
          name: build-Android
          path: build/Android


  deployPages:
    needs: buildWebGL
    name: Deploy to Github Pages
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - uses: actions/download-artifact@v2
        with:
          name: build-WebGL
          path: build

      - name: Deploy
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages
          folder: build/WebGL

GitHub actions attempt to upload my coverage reports to CodeCov, but I get an error. Below is my most recent GitHub Action code, and the error I'm receiving from CodeCov. Please let me know if there is any more information I can provide.

name: Build

on: 
  push:
    branches: [master]
  pull_request:
    branches: [master]

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
  testRunner:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - EditMode
          - PlayMode
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-test-project-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-test-project-
            Library-

      - uses: game-ci/[email protected]
        id: testRunner
        with:
          testMode: ${{ matrix.testMode }}
          checkName: ${{ matrix.testMode }} test results
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          customParameters: -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./coverage-results -coverageOptions generateAdditionalMetrics


      - uses: actions/upload-artifact@v2
        with:
          name: Test results (${{ matrix.testMode }})
          path: ${{ steps.testRunner.outputs.artifactsPath }}
          
  codeCov:
    needs: testRunner
    name: Submit to CodeCov
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Upload XML report to Codecov
        uses: codecov/codecov-action@v2
        with:
          name: CodeCov
          flags: automated
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage-results/**/*.xml
          


  buildWebGL:
    needs: codeCov
    name: Build for WebGL
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-WebGL
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: WebGL

      - uses: actions/upload-artifact@v2
        with:
          name: build-WebGL
          path: build/WebGL

  buildWindows:
    needs: codeCov
    name: Build for Windows
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-StandaloneWindows64
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: StandaloneWindows64

      - uses: actions/upload-artifact@v2
        with:
          name: build-StandaloneWindows64
          path: build/StandaloneWindows64

  buildAndroid:
    needs: codeCov
    name: Build for Android
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Create LFS file list
        run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

      - name: Restore LFS cache
        uses: actions/cache@v2
        id: lfs-cache
        with:
          path: .git/lfs
          key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

      - name: Git LFS Pull
        run: |
          git lfs pull
          git add .
          git reset --hard

      - name: Restore Library cache
        uses: actions/cache@v2
        with:
          path: Library
          key: Library-build-Android
          restore-keys: |
            Library-build-
            Library-

      - uses: game-ci/unity-builder@v2
        with:
          targetPlatform: Android

      - uses: actions/upload-artifact@v2
        with:
          name: build-Android
          path: build/Android


  deployPages:
    needs: buildWebGL
    name: Deploy to Github Pages
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - uses: actions/download-artifact@v2
        with:
          name: build-WebGL
          path: build

      - name: Deploy
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages
          folder: build/WebGL
added 7175 characters in body
Source Link
JShoe
  • 75
  • 8
Loading
Notice added Draw attention by JShoe
Bounty Started worth 100 reputation by JShoe
Added progress I made.
Source Link
JShoe
  • 75
  • 8
Loading
Source Link
JShoe
  • 75
  • 8
Loading