From 4c272765e44026a06013852ec885eabc0ca13077 Mon Sep 17 00:00:00 2001 From: Akhilesh Date: Wed, 6 Mar 2024 18:39:50 +0000 Subject: [PATCH] ci: refactor workflows --- .github/workflows/build.yml | 12 +++----- .github/workflows/unit-test-results.yml | 39 ------------------------- 2 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/unit-test-results.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5432966..422bde1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,5 @@ name: build on: - push: - branches: - - main pull_request: branches: - main @@ -23,9 +20,8 @@ jobs: run: | rm -rf ./reports && mkdir ./reports; gotestsum --format standard-verbose --junitfile ./reports/junit.xml --raw-command -- go test -parallel 5 --json ./...; - - name: Upload Test Results - if: always() - uses: actions/upload-artifact@v4 + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action@v2.15.1 with: - name: Unit Test Results - path: reports/*.xml + commit: ${{ github.event.workflow_run.head_sha }} + files: "reports/*.xml" \ No newline at end of file diff --git a/.github/workflows/unit-test-results.yml b/.github/workflows/unit-test-results.yml deleted file mode 100644 index 724ac88..0000000 --- a/.github/workflows/unit-test-results.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Unit Test Results - -on: - workflow_run: - workflows: ["build"] - types: - - completed - -jobs: - unit-test-results: - name: Unit Test Results - runs-on: ubuntu-latest - if: > - github.event.workflow_run.conclusion != 'skipped' - - steps: - - name: Download package - uses: actions/download-artifact@v4 - with: - name: Unit Test Results - path: ./artifacts - - - name: Extract Artifacts - run: | - for file in artifacts/*.zip - do - if [ -f "$file" ] - then - dir="${file/%.zip/}" - mkdir -p "$dir" - unzip -d "$dir" "$file" - fi - done - - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v2.15.1 - with: - commit: ${{ github.event.workflow_run.head_sha }} - files: "artifacts/*/**/*.xml"