Compare commits

...

9 Commits

Author SHA1 Message Date
9aae9cd77b add Project settings and artifact naming
All checks were successful
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 23s
Test / Gradle-Test (push) Successful in 13s
2025-02-08 16:51:21 +01:00
ca52d8f04c Merge pull request 'Add CI/CD' (#2) from feat/ci-cd into master
All checks were successful
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 45s
Test / Gradle-Test (push) Successful in 17s
Reviewed-on: #2
2025-02-07 13:44:44 +00:00
6dc1446143 fix directory not existing failing the job
All checks were successful
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 1m2s
Test / Gradle-Test (push) Successful in 31s
2025-02-07 14:40:22 +01:00
eb18df79c9 add test workflow
Some checks failed
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 1m50s
Test / Gradle-Test (push) Failing after 51s
2025-02-07 10:33:26 +01:00
e1f20aeeaf bump gradle version
All checks were successful
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 1m56s
2025-02-06 14:15:59 +01:00
a2e96c7df9 x2
Some checks failed
github-mirror / push-github (push) Successful in 3s
Build / Gradle-Build (push) Failing after 1m36s
2025-02-06 14:00:51 +01:00
be62aad19c fix disappeared part of name
Some checks failed
github-mirror / push-github (push) Successful in 3s
Build / Gradle-Build (push) Failing after 1s
2025-02-06 13:59:56 +01:00
d6d37f391a test different java version
Some checks failed
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Failing after 1s
2025-02-06 13:57:50 +01:00
9e80e06d18 add gradle build workflow
Some checks failed
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Failing after 1m2s
2025-02-06 12:13:40 +01:00
4 changed files with 117 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
name: Build
on:
push:
jobs:
Gradle-Build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '23'
check-latest: true
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary: always
cache-cleanup: on-success
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: chmod +x gradlew; ./gradlew assemble
- name: Move artifacts
run: mkdir artifacts; mv app/build/libs/*.jar artifacts;
- name: Upload artifact
uses: christopherhx/gitea-upload-artifact@v4
with:
name: artifacts
path: artifacts

View File

@@ -0,0 +1,53 @@
name: Test
on:
push:
jobs:
Gradle-Test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '23'
check-latest: true
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary: always
cache-cleanup: on-success
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Test
env:
DISCORD_TEST_TOKEN: ${{ secrets.DISCORD_TOKEN }}
run: chmod +x gradlew; ./gradlew test
- name: Move Test Results
if: always()
continue-on-error: true
run: |
mkdir test-results/;
[ -d app/build/test-results/test/ ] && mv app/build/test-results/test/*.xml test-results/ || true
- name: Upload Test Result
uses: christopherhx/gitea-upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/

16
build.gradle.kts Normal file
View File

@@ -0,0 +1,16 @@
import java.io.ByteArrayOutputStream
allprojects {
group = "net.tomatentum.tomatenmusic3"
version = "1.0.0-RC1" + (if (!project.hasProperty("release")) ("-" + getGitHash()) else "")
description = "A simple Discord Music Bot written in Java with Javacord"
}
fun getGitHash(): String {
val output = ByteArrayOutputStream()
project.exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = output
}
return output.toString().trim()
}

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME