Repository navigation
Гард роли в навигации ресурсов и пользователей #168
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR pipeline | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: ./.github/actions/setup-jdk | |
| - name: Build with Maven | |
| run: mvn -B package --file pom.xml | |
| - name: Update dependency graph | |
| uses: advanced-security/maven-dependency-submission-action@v5 | |
| continue-on-error: true | |
| with: | |
| directory: . | |
| maven-args: "-DmergeClassifiers=true" | |
| format: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: ./.github/actions/setup-jdk | |
| - name: Check formatting | |
| # -nsu безопасен: SNAPSHOT-зависимостей нет. | |
| run: mvn -B -nsu spotless:check --file pom.xml | |
| lint: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: ./.github/actions/setup-jdk | |
| - name: Restore checkstyle cache | |
| uses: actions/cache@v5 | |
| with: | |
| # Путь совпадает с cacheFile в pom.xml. | |
| path: target/checkstyle-cachefile | |
| key: checkstyle-${{ hashFiles('checkstyle.xml', 'pom.xml') }} | |
| restore-keys: checkstyle- | |
| - name: Check lint | |
| # -nsu безопасен: SNAPSHOT-зависимостей нет. | |
| run: mvn -B -nsu checkstyle:check --file pom.xml | |
| junit: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: ./.github/actions/setup-jdk | |
| - name: Run tests | |
| run: mvn -B test --file pom.xml | |
| - name: Generate Allure HTML report | |
| # Версия совпадает с allure-maven.version в pom.xml. | |
| # Результат задания определяют тесты: генерация не маскирует их статус | |
| # и не роняет задание при отсутствии результатов. | |
| if: always() | |
| continue-on-error: true | |
| run: mvn -B io.qameta.allure:allure-maven:2.17.0:report --file pom.xml | |
| - name: Upload Allure raw results | |
| if: always() | |
| continue-on-error: true | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: allure-results | |
| path: target/allure-results | |
| retention-days: 21 | |
| if-no-files-found: warn | |
| - name: Upload Allure HTML report | |
| if: always() | |
| continue-on-error: true | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: allure-report | |
| path: target/allure-report | |
| retention-days: 21 | |
| if-no-files-found: warn |