Implementing GitHub Actions Pipeline #104
This file contains 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
# © 2024. TU Dortmund University, | |
# Institute of Energy Systems, Energy Efficiency and Energy Economics, | |
# Research group Distribution grid planning and operation | |
# | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
- 'feature/*' | |
- 'hotfix/*' | |
- 'release/*' | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref || github.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
- name: Check Branch & Files | |
run: | | |
git rev-parse --abbrev-ref HEAD | |
pwd | |
ls -la | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle 8.10 | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
gradle-version: "8.10" | |
- name: Build Project | |
run: | | |
./gradlew clean assemble | |
- name: Run Tests | |
run: | | |
./gradlew --refresh-dependencies spotlessCheck pmdMain pmdTest test | |
- name: Build Java-Docs | |
run: | | |
./gradlew javadoc | |
- name: Run SonarQube with Gradle | |
run: ./gradlew reportScoverage sonarqube -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} -Dsonar.host.url=${{ vars.SONAR_HOST_URL }} -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.branch.name=${{ github.head_ref || github.ref_name }} |