From 7e8498471266fb4197010a8809da8e3d7cea0c00 Mon Sep 17 00:00:00 2001 From: silrenan <75952546+silrenan@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:33:01 -0300 Subject: [PATCH] refactor: implement Qodana workflow reporting and artifact handling This commit consolidates multiple improvements to the Qodana GitHub Actions workflow: - Replaces Qodana action with direct Docker run for flexibility - Logs Qodana output and lists results directory - Updates artifact upload actions and summary formatting - Adds workflow_dispatch trigger and linter configuration Signed-off-by: sirenan <75952546+silrenan@users.noreply.github.com> --- .github/workflows/qodana.yml | 46 +++++++++++++++++++ README.md | 3 +- .../pedr0limpio/resources/TaskResource.java | 2 + 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/qodana.yml diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml new file mode 100644 index 0000000..ee93f60 --- /dev/null +++ b/.github/workflows/qodana.yml @@ -0,0 +1,46 @@ +name: Qodana + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + qodana-docker: + runs-on: ubuntu-latest + + steps: + # Checkout the repository code + - name: Checkout code + uses: actions/checkout@v3 + + # Set up Docker Buildx + - name: Set up Docker + uses: docker/setup-buildx-action@v3 + + # Run Qodana analysis inside Docker and save CLI output to a log file + - name: Run Qodana via Docker + run: | + mkdir -p ${{ github.workspace }}/qodana-results + docker run --rm \ + -v ${{ github.workspace }}:/data \ + -v ${{ github.workspace }}/qodana-results:/data/results \ + -w /data \ + jetbrains/qodana-jvm-community:2024.1 | tee ${{ github.workspace }}/qodana-results/qodana.log + + # Upload the Qodana results as a workflow artifact for download + - name: Upload Qodana Report + uses: actions/upload-artifact@v4 + with: + name: Qodana Report + path: ${{ github.workspace }}/qodana-results + + # Remove previous Qodana Report Info steps and add a new concise summary + - name: Qodana Summary + if: always() + run: | + echo "### Qodana - Run Status" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Qodana analysis has completed. For detailed results and findings, please download the Qodana report artifact from the Artifacts section below." >> $GITHUB_STEP_SUMMARY diff --git a/README.md b/README.md index ec42fc0..1330eae 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Qodana](https://github.com/pedr0limpio/tasky/actions/workflows/qodana.yml/badge.svg)](https://github.com/pedr0limpio/tasky/actions/workflows/qodana.yml) ![build badge](https://github.com/pedr0limpio/tasky/actions/workflows/maven.yml/badge.svg?event=push&branch=main) # Tasky - a simple todo tool @@ -43,4 +44,4 @@ If you want to learn more about building native executables, please consult