Skip to content

Merge branch 'main' of github.com:MouserRU/java-project-71 #2

Merge branch 'main' of github.com:MouserRU/java-project-71

Merge branch 'main' of github.com:MouserRU/java-project-71 #2

Workflow file for this run

# file: .github/workflows/main.yml

Check failure on line 1 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

(Line: 14, Col: 9): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory, (Line: 16, Col: 9): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory
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