-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: dev
Are you sure you want to change the base?
Changes from all commits
a5e7882
c205a34
0d7d256
81864ff
e21113c
1a322fe
a358186
ef8ef61
9ff6b0f
7a63e64
58b398b
4907ebd
717170d
868926f
272364d
c6f72b1
5d624e7
cc50142
9979cc8
82c04b5
2f5d1ed
423824b
de427e9
4801167
cc21a2e
6ebc5e2
3434da4
485d6c1
f136f27
f024771
ae3f414
cc00df1
c892a8c
442d31b
88b4447
26273dd
b9016d1
07e1442
16db60d
b21805d
ddd5a92
d9260e9
bdd7906
d537e09
160bd99
caafefe
f85defe
b7440c8
c9f7e42
68a7fc1
9c53be5
0e57156
5ff88ec
b0b8a7d
7f6a281
c14c0a6
4b3e51c
99a876e
50979d2
7aa55ba
25346e6
8c4b71b
517d9e5
f58d317
f113040
62656db
8999526
21835f8
47dc2b2
f623598
a6ee586
fed2642
c0b408b
51a29b8
a7d508d
9a84f3e
26d977f
5aa9679
da5336b
8da5343
4b65e11
5ec36de
fc39fbb
e279c01
5044de6
711beae
1d0ba09
f703367
d060f80
7eab786
cee3934
54dce13
c96acf7
7275f38
3eb67df
cc45c56
2ad00b1
0671015
aaacfdb
57534b8
9e2f3e8
7d76f17
91a9366
cfcabbf
8db5445
1ff1b5a
58ada89
50386fc
33007be
5042d36
5c8ea2b
e6b7e23
0a0174b
00fd90a
fa44b06
d203385
1ff759c
9d5d395
15ef2df
a8fd9ee
39693e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# © 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/*' | ||
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You probably know this, but these have to be adapted to the branch naming scheme that we use |
||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need the pull_request specification, if CI is running on branches already? |
||
|
||
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: Determine Project Version | ||
id: version | ||
run: | | ||
branch_name=$(echo ${{ github.ref_name }}) | ||
project_version=$(./gradlew -q $([ "$branch_name" = "dev" ] && echo "devVersion" || echo "currentVersion")) | ||
echo "project_version=${project_version}" >> $GITHUB_ENV | ||
|
||
- 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" | ||
Comment on lines
+48
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like you can leave out the specification of the version if the project already configures gradle (which it does). |
||
|
||
- name: Build Project | ||
run: | | ||
./gradlew clean assemble | ||
|
||
- name: Run Tests | ||
run: | | ||
./gradlew --refresh-dependencies spotlessCheck pmdMain pmdTest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
- name: Build Scala-Docs | ||
run: | | ||
./gradlew scaladoc | ||
|
||
- name: SonarQube Analysis | ||
uses: sonarsource/sonarqube-scan-action@master | ||
with: | ||
projectBaseDir: '.' | ||
args: > | ||
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} | ||
-Dsonar.java.binaries=build/classes/scala/main | ||
-Dsonar.verbose=true | ||
-Dsonar.sourceEncoding=UTF-8 | ||
-Dsonar.sources=src/main/resources,src/main/scala | ||
-Dsonar.tests=src/test/resources,src/test/scala,src/test/groovy | ||
-Dsonar.junit.reportPaths=build/test-results/test | ||
-Dsonar.scala.scapegoat.reportPaths=build/reports/scapegoat/src/scapegoat-scalastyle.xml,build/reports/scapegoat/testsrc/scapegoat-scalastyle.xml | ||
-Dsonar.scala.coverage.reportPaths=build/reports/scoverageTest/scoverage.xml | ||
-Dsonar.groovy.binaries=build/classes/groovy | ||
-Dsonar.exclusions=src/main/scala/edu/ie3/simona/config/SimonaConfig.scala | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} | ||
|
||
- name: SonarQube Quality Gate | ||
id: sonarqube-quality-gate-check | ||
uses: sonarsource/sonarqube-quality-gate-action@master | ||
# Force to fail step after specific time. | ||
timeout-minutes: 60 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could probably be reduced (but isn't that important) |
||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} | ||
|
||
- name: Deploy | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' | ||
run: | | ||
./gradlew --refresh-dependencies test publish\ | ||
-Puser=${{ secrets.MAVENCENTRAL_USER }} \ | ||
-Ppassword=${{ secrets.MAVENCENTRAL_PASS }} \ | ||
-Psigning.keyId=${{ secrets.MAVENCENTRAL_SIGNINGKEYID }} \ | ||
-Psigning.password=${{ secrets.MAVENCENTRAL_SIGNINGPASS }} \ | ||
-Psigning.secretKeyRingFile=${{ secrets.MAVENCENTRAL_SIGNINGKEY }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paths-ignore
for docs could also be useful? readthedocs has its separate CI