Test Automation Report not able to upload using upload-artifact

Below is the yml file which run my test suite using maven and try to upload test report as artifact:

name : First git action workflow
on :
 push :
  branches:
     'main'
jobs :
  test :
    name : Test Example
    runs-on : ubuntu-latest
    steps :
    - name : checkout
      uses : actions/checkout@v1
    
    - name : run pom file
      run : mvn test

    - if : always()
      run : |
           mkdir -p ${{ github.workspace }}/report
           cd report
           ls -l

    - if : always()
      uses : actions/upload-artifact@master
      with :
       name : automationReport.html
       path : ./report/TestReport*.html

Here, Report folder is automatically get created when we execute Test suite but when I try to use it in upload-artifact action, it is saying:

no files found under provided path

Click here to see screenshot

I want to upload artifact which is TestReport_currentdate.html, which is inside report folder. And report folder is automatically created when we execute script.

  • Do you see any generated files in the previous step with ls -l?

    – 

  • I don’t see any report folder generated but on local same code is generating report folder with TestReport_currentdate.html inside it.

    – 

  • Do you see mvn test run unit tests? You should add ls -l right after that.

    – 

Leave a Comment