diff --git a/.gitea/workflows/detekt.yml b/.gitea/workflows/detekt.yml index 5f7c1c5..e6c947f 100644 --- a/.gitea/workflows/detekt.yml +++ b/.gitea/workflows/detekt.yml @@ -1,22 +1,40 @@ -steps: - - name: Checkout code - uses: actions/checkout@v4 +name: Detekt - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] - - name: Download Detekt CLI # ← должен быть этот шаг - run: | - curl -sSLO https://github.com/detekt/detekt/releases/download/v1.23.6/detekt-cli-1.23.6-all.jar +jobs: + detekt: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 - - name: Run Detekt # ← и этот - run: | - java -jar detekt-cli-1.23.6-all.jar --input . --report txt:detekt-report.txt - continue-on-error: true + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' - - name: Show Detekt report # ← и этот для отчёта - run: cat detekt-report.txt - if: always() \ No newline at end of file + - name: Download Detekt CLI + run: | + curl -sSLO https://github.com/detekt/detekt/releases/download/v1.23.6/detekt-cli-1.23.6-all.jar + + - name: Run Detekt + run: | + java -jar detekt-cli-1.23.6-all.jar --input . --report txt:detekt-report.txt + continue-on-error: true + + - name: Show Detekt report + run: cat detekt-report.txt + if: always() + + - name: Upload Detekt report + uses: actions/upload-artifact@v4 + if: always() + with: + name: detekt-report + path: detekt-report.txt \ No newline at end of file