From bf47308c0065b8cd6fc16d14996fffe06e5d947d Mon Sep 17 00:00:00 2001 From: Sadra Barikbin Date: Tue, 2 Jan 2024 23:07:30 +0330 Subject: [PATCH] Add report_tests workflow --- .github/workflows/test.yml | 20 ++++---------------- .github/workflows/test_report.yml | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/test_report.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f8485a..5c592ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: Test on: @@ -29,9 +29,6 @@ jobs: runs-on: "ubuntu-latest" - env: - test_results_dir: test-results-${{ matrix.python-version }} - steps: - name: Set up Python uses: actions/setup-python@v4 @@ -52,19 +49,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