Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing GitHub Actions Pipeline #982

Open
wants to merge 151 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 148 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
a5e7882
Testing Checkout
PhilippSchmelter Oct 2, 2024
c205a34
Fixed Syntax
PhilippSchmelter Oct 2, 2024
0d7d256
Fixed Syntax
PhilippSchmelter Oct 2, 2024
81864ff
removed unnecessary steps
PhilippSchmelter Oct 2, 2024
e21113c
removed unnecessary steps
PhilippSchmelter Oct 2, 2024
1a322fe
Syntax
PhilippSchmelter Oct 2, 2024
a358186
Syntax
PhilippSchmelter Oct 2, 2024
ef8ef61
Test SSH
PhilippSchmelter Oct 2, 2024
9ff6b0f
Testing Build ENV
PhilippSchmelter Oct 2, 2024
7a63e64
Added wget
PhilippSchmelter Oct 2, 2024
58b398b
ENV
PhilippSchmelter Oct 2, 2024
4907ebd
added shell
PhilippSchmelter Oct 2, 2024
717170d
check java
PhilippSchmelter Oct 2, 2024
868926f
check java
PhilippSchmelter Oct 2, 2024
272364d
Created new Docker Image
PhilippSchmelter Oct 2, 2024
c6f72b1
Added Build and Test stage
PhilippSchmelter Oct 2, 2024
5d624e7
Fix
PhilippSchmelter Oct 2, 2024
cc50142
Added right order
PhilippSchmelter Oct 2, 2024
9979cc8
Fix
PhilippSchmelter Oct 2, 2024
82c04b5
Fix
PhilippSchmelter Oct 2, 2024
2f5d1ed
Fix
PhilippSchmelter Oct 2, 2024
423824b
Fix
PhilippSchmelter Oct 2, 2024
de427e9
Fix
PhilippSchmelter Oct 2, 2024
4801167
Fix
PhilippSchmelter Oct 2, 2024
cc21a2e
Fix
PhilippSchmelter Oct 2, 2024
6ebc5e2
Added Volume
PhilippSchmelter Oct 2, 2024
3434da4
Set clean to false
PhilippSchmelter Oct 2, 2024
485d6c1
Set clean to true
PhilippSchmelter Oct 2, 2024
f136f27
Fixed Volume Path
PhilippSchmelter Oct 2, 2024
f024771
Fixed Volume Path
PhilippSchmelter Oct 2, 2024
ae3f414
Fixed Volume Path
PhilippSchmelter Oct 2, 2024
cc00df1
Fixed Volume Path
PhilippSchmelter Oct 2, 2024
c892a8c
Fixed Volume Path
PhilippSchmelter Oct 2, 2024
442d31b
Fixed Volume Path
PhilippSchmelter Oct 2, 2024
88b4447
Bind Volume
PhilippSchmelter Oct 2, 2024
26273dd
Fixed Docker Image
PhilippSchmelter Oct 2, 2024
b9016d1
Fix
PhilippSchmelter Oct 2, 2024
07e1442
Fix
PhilippSchmelter Oct 2, 2024
16db60d
Fix
PhilippSchmelter Oct 2, 2024
b21805d
Fix
PhilippSchmelter Oct 2, 2024
ddd5a92
Fix
PhilippSchmelter Oct 2, 2024
d9260e9
Fix
PhilippSchmelter Oct 2, 2024
bdd7906
Fix
PhilippSchmelter Oct 2, 2024
d537e09
Fix Volume
PhilippSchmelter Oct 2, 2024
160bd99
Fix Volume
PhilippSchmelter Oct 2, 2024
caafefe
Fix Volume
PhilippSchmelter Oct 2, 2024
f85defe
Fix Volume
PhilippSchmelter Oct 2, 2024
b7440c8
Combined Checkout and Build
PhilippSchmelter Oct 2, 2024
c9f7e42
Fix
PhilippSchmelter Oct 2, 2024
68a7fc1
Fix
PhilippSchmelter Oct 2, 2024
9c53be5
Fix Vol
PhilippSchmelter Oct 2, 2024
0e57156
Added Artifact
PhilippSchmelter Oct 2, 2024
5ff88ec
Merge branch 'dev' into ps/#939-GitHubActionsPipeline
PhilippSchmelter Oct 2, 2024
b0b8a7d
Added Artifact
PhilippSchmelter Oct 2, 2024
7f6a281
Added Artifact
PhilippSchmelter Oct 2, 2024
c14c0a6
Fix syntax
PhilippSchmelter Oct 2, 2024
4b3e51c
Debug
PhilippSchmelter Oct 2, 2024
99a876e
Debug
PhilippSchmelter Oct 2, 2024
50979d2
Debug
PhilippSchmelter Oct 2, 2024
7aa55ba
STOP
PhilippSchmelter Oct 2, 2024
25346e6
test
PhilippSchmelter Oct 2, 2024
8c4b71b
Volume
PhilippSchmelter Oct 2, 2024
517d9e5
Using Cache
PhilippSchmelter Oct 3, 2024
f58d317
Cache Fix
PhilippSchmelter Oct 4, 2024
f113040
Cache Fix
PhilippSchmelter Oct 4, 2024
62656db
Cache Fix
PhilippSchmelter Oct 4, 2024
8999526
Cache Fix
PhilippSchmelter Oct 4, 2024
21835f8
Cache Fix
PhilippSchmelter Oct 4, 2024
47dc2b2
Cache Fix
PhilippSchmelter Oct 4, 2024
f623598
Cache Fix
PhilippSchmelter Oct 4, 2024
a6ee586
Cache Fix
PhilippSchmelter Oct 4, 2024
fed2642
Cache Fix
PhilippSchmelter Oct 4, 2024
c0b408b
Cache Fix
PhilippSchmelter Oct 4, 2024
51a29b8
Using artifacts
PhilippSchmelter Oct 4, 2024
a7d508d
Changed approach in passing files
PhilippSchmelter Oct 4, 2024
9a84f3e
Changed approach in passing files
PhilippSchmelter Oct 4, 2024
26d977f
Debug
PhilippSchmelter Oct 4, 2024
5aa9679
Fixed Path
PhilippSchmelter Oct 7, 2024
da5336b
Fixed Path
PhilippSchmelter Oct 7, 2024
8da5343
Fixed Path
PhilippSchmelter Oct 7, 2024
4b65e11
Fixed Path
PhilippSchmelter Oct 7, 2024
5ec36de
Fixed Path
PhilippSchmelter Oct 7, 2024
fc39fbb
Caching Gradle Dependencies
PhilippSchmelter Oct 8, 2024
e279c01
Removed workdir
PhilippSchmelter Oct 8, 2024
5044de6
Fixes
PhilippSchmelter Oct 8, 2024
711beae
Fixes
PhilippSchmelter Oct 8, 2024
1d0ba09
Removed Artifacting
PhilippSchmelter Oct 8, 2024
f703367
Seperated Build Artifact and Gradle Cache
PhilippSchmelter Oct 8, 2024
d060f80
All jobs in one stage test
PhilippSchmelter Oct 8, 2024
7eab786
Fixed permissions
PhilippSchmelter Oct 8, 2024
cee3934
Test
PhilippSchmelter Oct 8, 2024
54dce13
Test
PhilippSchmelter Oct 8, 2024
c96acf7
Test
PhilippSchmelter Oct 8, 2024
7275f38
Changed approach
PhilippSchmelter Oct 8, 2024
3eb67df
Added Sonar
PhilippSchmelter Oct 8, 2024
cc45c56
Added Sonar
PhilippSchmelter Oct 9, 2024
2ad00b1
Added sonar credentials
PhilippSchmelter Oct 9, 2024
0671015
Merge branch 'dev' into ps/#939-GitHubActionsPipeline
PhilippSchmelter Oct 16, 2024
aaacfdb
Moved reportScoverage
PhilippSchmelter Oct 16, 2024
57534b8
Moved reportScoverage
PhilippSchmelter Oct 16, 2024
9e2f3e8
Moved reportScoverage
PhilippSchmelter Oct 16, 2024
7d76f17
Switched to action
PhilippSchmelter Oct 16, 2024
91a9366
Switched to action
PhilippSchmelter Oct 16, 2024
cfcabbf
Back to gradle
PhilippSchmelter Oct 16, 2024
8db5445
Merge branch 'dev' into ps/#939-GitHubActionsPipeline
PhilippSchmelter Oct 17, 2024
1ff1b5a
Removed dependencies from sonarqube.gradle
PhilippSchmelter Oct 17, 2024
58ada89
Added deployment step and sonar quality gate
PhilippSchmelter Oct 17, 2024
50386fc
fixed time format
PhilippSchmelter Oct 17, 2024
33007be
debug
PhilippSchmelter Oct 17, 2024
5042d36
Added dependencie to sonarqube.gradle and changed workflow
PhilippSchmelter Oct 17, 2024
5c8ea2b
sonar
PhilippSchmelter Oct 17, 2024
e6b7e23
Switched to action
PhilippSchmelter Oct 17, 2024
0a0174b
Added path to binaries
PhilippSchmelter Oct 17, 2024
00fd90a
Added path to binaries
PhilippSchmelter Oct 17, 2024
fa44b06
Debug
PhilippSchmelter Oct 17, 2024
d203385
Debug
PhilippSchmelter Oct 17, 2024
1ff759c
Debug
PhilippSchmelter Oct 17, 2024
9d5d395
Finished Prototype
PhilippSchmelter Oct 17, 2024
15ef2df
Finished Prototype
PhilippSchmelter Oct 17, 2024
a8fd9ee
Changed Java-Docs to Scala-Docs
PhilippSchmelter Oct 17, 2024
39693e6
Merge branch 'dev' into ps/#939-GitHubActionsPipeline
PhilippSchmelter Oct 22, 2024
25d7cba
Merge branch 'dev' into ps/#939-GitHubActionsPipeline
PhilippSchmelter Oct 29, 2024
07aded5
Resolved Conversations
PhilippSchmelter Oct 29, 2024
acc22f5
Changed branches
PhilippSchmelter Oct 29, 2024
42ab8ea
Switched from Sonarqube analysis Action to gradlew
PhilippSchmelter Oct 29, 2024
f86ebc5
Create Reports and changed path
PhilippSchmelter Oct 29, 2024
f68e062
fetch-depth
PhilippSchmelter Oct 29, 2024
771f7a6
Quality-Gate status script
PhilippSchmelter Oct 29, 2024
dce2b7e
debug
PhilippSchmelter Oct 29, 2024
4909196
debug
PhilippSchmelter Oct 29, 2024
b8ff218
debug
PhilippSchmelter Oct 29, 2024
1cc1e06
Using reportScoverage
PhilippSchmelter Nov 2, 2024
cd5df02
debug path
PhilippSchmelter Nov 2, 2024
8d09497
debug path
PhilippSchmelter Nov 2, 2024
8d8cc69
debug path
PhilippSchmelter Nov 2, 2024
5350f99
debug path
PhilippSchmelter Nov 2, 2024
10ee88f
debug path
PhilippSchmelter Nov 2, 2024
8940d9f
Merge branch 'dev' into ps/#939-GitHubActionsPipeline
PhilippSchmelter Nov 5, 2024
21c2da0
Merged some steps
PhilippSchmelter Nov 5, 2024
521f9da
rem debug
PhilippSchmelter Nov 5, 2024
925122b
switched to sonarqube
PhilippSchmelter Nov 5, 2024
719a00c
Added CheckScov
PhilippSchmelter Nov 5, 2024
e091efc
Remove args
PhilippSchmelter Nov 5, 2024
6505eb4
Outcommented sonar stage in jenkins
PhilippSchmelter Nov 5, 2024
694009a
Testing Sonar
PhilippSchmelter Nov 5, 2024
62bf935
Prototype
PhilippSchmelter Nov 5, 2024
6830545
Removed DummyCode
PhilippSchmelter Nov 5, 2024
2897c01
Jenkinsfile back to dev version
PhilippSchmelter Nov 5, 2024
2207df8
spotless back in test
PhilippSchmelter Nov 5, 2024
4d6e390
Prototype
PhilippSchmelter Nov 5, 2024
b05eaaa
Resolved conversations
PhilippSchmelter Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# © 2024. TU Dortmund University,
# Institute of Energy Systems, Energy Efficiency and Energy Economics,
# Research group Distribution grid planning and operation
#

name: CI

on:
push:
PhilippSchmelter marked this conversation as resolved.
Show resolved Hide resolved
paths-ignore:
- 'docs/**'
branches:
- main
- dev
- 'hotfix/*'
- 'rel/*'
- 'dependabot/*'
pull_request:
branches:
- main
- dev
PhilippSchmelter marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:
PhilippSchmelter marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest

steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
fetch-depth: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fetches all history for all branches. Is that necessary?

ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Check Code Formatting
run: ./gradlew spotlessCheck

- name: Build Project
run: ./gradlew --refresh-dependencies clean assemble

- name: Run Tests
run: ./gradlew pmdMain pmdTest reportScoverage checkScoverage

- name: Build Scala-Docs
run: ./gradlew scaladoc

- name: SonarQube
run: |
./gradlew sonarqube \
PhilippSchmelter marked this conversation as resolved.
Show resolved Hide resolved
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} \
-Dsonar.host.url=${{ vars.SONAR_HOST_URL }} \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}

SONAR_STATUS_URL="${{ vars.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=${{ vars.SONAR_PROJECT_KEY }}"
QUALITY_GATE_STATUS=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" "$SONAR_STATUS_URL" | jq -r '.projectStatus.status')

echo "Quality Gate Status: $QUALITY_GATE_STATUS"
if [ "$QUALITY_GATE_STATUS" != "OK" ]; then
echo "Quality Gate failed!"
exit 1
fi

- name: Deploy
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: |
./gradlew --refresh-dependencies test publish\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have to refresh dependencies and run tests again here. Maybe I'm wrong, but we'd find that out later on

-Puser=${{ secrets.MAVENCENTRAL_USER }} \
-Ppassword=${{ secrets.MAVENCENTRAL_PASS }} \
-Psigning.keyId=${{ secrets.MAVENCENTRAL_SIGNINGKEYID }} \
-Psigning.password=${{ secrets.MAVENCENTRAL_SIGNINGPASS }} \
-Psigning.secretKeyRingFile=${{ secrets.MAVENCENTRAL_SIGNINGKEY }}
2 changes: 0 additions & 2 deletions gradle/scripts/sonarqube.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ sonarqube {
}

// sonarqube task dependencies
project.tasks["sonarqube"].dependsOn "pmdMain"
project.tasks["sonarqube"].dependsOn "pmdTest"
project.tasks["sonarqube"].dependsOn "test"
project.tasks["sonarqube"].dependsOn "reportScoverage"
project.tasks["sonarqube"].dependsOn "checkScoverage"
Loading