add and replace fies #3
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
| # file: .github/workflows/main.yml | ||
|
Check failure on line 1 in .github/workflows/main.yml
|
||
| name: My project CI | ||
| # on – определяет события, которые запускают воркфлоу | ||
| on: | ||
| - push | ||
| - pull_request | ||
| jobs: # задания: | ||
| build: | ||
| # операционная система для работы воркфлоу | ||
| runs-on: ubuntu-latest | ||
| steps: # список шагов, которые надо выполнить | ||
| # экшен — выполняет какую-то задачу | ||
| # checkout — клонирует репозиторий | ||
| - name: Repository cloning | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Java # Устанавливаем java | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
| - name: Setup Gradle # Устанавливаем Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
| with: | ||
| fetch-depth: 0 # Параметр 0 означает, что нужно загружать всю историю коммитов | ||
| - name: Execute Gradle build # Сборка проекта | ||
| # run – bash-команда | ||
| run: ./gradlew build | ||
| - name: Generate coverage report # Создание отчета покрытия тестами | ||
| run: ./gradlew jacocoTestReport | ||
| - name: Cache SonarQube packages # Кеширование файлов SonarQube | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.sonar/cache | ||
| key: ${{ runner.os }}-sonar | ||
| restore-keys: ${{ runner.os }}-sonar | ||
| - name: Cache Gradle packages # Кеширование зависимостей Gradle | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.gradle/caches | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
| restore-keys: ${{ runner.os }}-gradle | ||
| - name: Build and analyze # Сборка и анализ на SonarQube | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| run: ./gradlew sonar --info | ||