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