Home > Blockchain >  Coverage XML output file is not seen in Github Actions uses
Coverage XML output file is not seen in Github Actions uses

Time:09-02

Im trying to use the coverage report by irongut, for a test method, where in a docker container the test is running, but the output XML file is not seen. What am I missing, the path is different? Or am i completely messing up the flow.

Github Actions input part:

    uses: addnab/docker-run-action@v3
    with:
      image: pythontest:latest
      options: |
        -e MYSQL_DATABASE=lena-db
      run: |
        coverage run --rcfile=.coveragerc manage.py test lena_transport
        coverage xml -o ./coverage
  -
    name: Coverage report
    uses: irongut/[email protected]
    with:
      filename: ./coverage/*.xml
      badge: true
      fail_below_min: true
      format: markdown
      hide_branch_rate: false
      hide_complexity: true
      indicators: true
      output: both
      thresholds: '60 80'

Output:

Run irongut/[email protected]
/usr/bin/docker run --name ghcrioirongutcodecoveragesummaryv130_2ecc5b --label 229416 --workdir /github/workspace --rm -e "version" -e "INPUT_FILENAME" -e "INPUT_BADGE" -e "INPUT_FAIL_BELOW_MIN" -e "INPUT_FORMAT" -e "INPUT_HIDE_BRANCH_RATE" -e "INPUT_HIDE_COMPLEXITY" -e "INPUT_INDICATORS" -e "INPUT_OUTPUT" -e "INPUT_THRESHOLDS" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ltlwrk-python/ltlwrk-python":"/github/workspace" ghcr.io/irongut/codecoveragesummary:v1.3.0  "--files" "coverage/**/coverage.cobertura.xml" "--badge" "true" "--fail" "true" "--format" "markdown" "--hidebranch" "false" "--hidecomplexity" "true" "--indicators" "true" "--output" "both" "--thresholds" "60 80"
Error: No files found matching glob pattern.

EDIT: I used PWD and LS -A to print out the working directory and to check if the file is present, its right there, the paths are correct to my understanding still unable to generate the report.

CodePudding user response:

It looks like you are asking to write the XML to a file called ./coverage, but are then looking for ./coverage/*.xml. You mentioned using ls -a, can you show us what it is showing you?

CodePudding user response:

Apparently the solution was to create a bind mount from the container to the host, so the coverage reporter can access.

  • Related