diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61dc014..69e7ffc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: Test on: @@ -30,9 +30,6 @@ jobs: # For Python 3.6, we need to fall back to Ubuntu 20.04 runs-on: ${{ matrix.python-version == '3.6' && 'ubuntu-20.04' || 'ubuntu-latest' }} - env: - test_results_dir: test-results-${{ matrix.python-version }} - steps: - name: Set up Python uses: actions/setup-python@v4 @@ -58,19 +55,10 @@ jobs: - name: Test run: | cd src - mkdir -p ../$test_results_dir - python3 -m pytest --junitxml=../$test_results_dir/junit.xml -o junit_family=legacy + python3 -m pytest --junitxml=../junit.xml -o junit_family=legacy - name: Upload test results uses: actions/upload-artifact@v3 if: success() || failure() with: - name: ${{ env.test_results_dir }} - path: ${{ env.test_results_dir }} - - - name: Report tests - uses: dorny/test-reporter@v1 - if: success() || failure() - with: - name: Results on Python ${{ matrix.python-version }} - path: "${{env.test_results_dir }}/junit.xml" - reporter: java-junit + name: test-results-${{matrix.python-version}} + path: junit.xml diff --git a/.github/workflows/test_report.yml b/.github/workflows/test_report.yml new file mode 100644 index 0000000..f237661 --- /dev/null +++ b/.github/workflows/test_report.yml @@ -0,0 +1,20 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['test'] + types: + - completed +permissions: + contents: read + actions: read + checks: write +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: /test-results-.*/ + name: Tests Results + path: 'junit.xml' + reporter: jest-junit \ No newline at end of file