Skip to content

Implementing GitHub Actions Pipeline #91

Implementing GitHub Actions Pipeline

Implementing GitHub Actions Pipeline #91

Workflow file for this run

# © 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
container:
image: gradle:8.10-jdk17
steps:
- name: Checkout Code
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 config --global --add safe.directory /__w/simona/simona
git rev-parse --abbrev-ref HEAD
pwd
ls -la
- name: Checking Gradle & Java
run: |
java -version && gradle --version
- name: Running Tests
run: |
./gradlew --no-daemon --info --refresh-dependencies spotlessCheck pmdMain pmdTest test -x build -x compileJava -x compileTestJava -x assemble
- name: Generate JavaDoc
run: |
./gradlew javadoc
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
./gradle/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: ./build/
test:
needs: build
runs-on: ubuntu-latest
container:
image: gradle:8.10-jdk17
services:
docker:
image: docker:19.03.12
options: --privileged
steps:
- name: Checkout Code
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: Running Tests
run: |
./gradlew --no-daemon --info --refresh-dependencies spotlessCheck pmdMain pmdTest test -x build -x compileJava -x compileTestJava -x assemble
- name: Generate JavaDoc
run: |
./gradlew javadoc