Skip to content

Commit

Permalink
MAIN-T-91 Github Action CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hanna-eismant committed Mar 22, 2024
1 parent 73a6df1 commit a383ebf
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 60 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,33 @@ jobs:
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Run tests with Gradle Wrapper
run: ./gradlew integrationTest -PrunIntegrationTests=true

api:
runs-on: ubuntu-latest
permissions:
contents: read
services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_DATABASE: doky-test
MYSQL_ROOT_PASSWORD: doky-test
MYSQL_USER: doky-test
MYSQL_PASSWORD: doky-test
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Run tests with Gradle Wrapper
run: ./gradlew apiTest -PrunApiTests=true
60 changes: 0 additions & 60 deletions .space.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,6 @@ import java.time.temporal.TemporalAdjusters

val gradleImageVersion = "gradle:8.2-jdk17"

job("Tests for development branches") {
startOn {
gitPush {
anyRefMatching {
+"refs/heads/*"
-"refs/heads/main"
}
}
}

container(displayName = "Unit tests", image = gradleImageVersion) {
workDir = "server"
kotlinScript { api ->
api.gradlew("koverVerify")
}
}

container(displayName = "Integration tests", image = gradleImageVersion) {
env["DB_HOST"] = "db"
env["DB_PORT"] = "3306"
service("mysql:8") {
alias("db")
args(
"--log_bin_trust_function_creators=ON",
"--max-connections=700"
)
env["MYSQL_ROOT_PASSWORD"] = "doky-test"
env["MYSQL_DATABASE"] = "doky-test"
env["MYSQL_USER"] = "doky-test"
env["MYSQL_PASSWORD"] = "doky-test"
}

workDir = "server"
kotlinScript { api ->
api.gradlew("integrationTest", "-PrunIntegrationTests=true")
}
}

container(displayName = "API tests", image = gradleImageVersion) {
env["DB_HOST"] = "db"
env["DB_PORT"] = "3306"
service("mysql:8") {
alias("db")
args(
"--log_bin_trust_function_creators=ON",
"--max-connections=700"
)
env["MYSQL_ROOT_PASSWORD"] = "doky-test"
env["MYSQL_DATABASE"] = "doky-test"
env["MYSQL_USER"] = "doky-test"
env["MYSQL_PASSWORD"] = "doky-test"
}

workDir = "server"
kotlinScript { api ->
api.gradlew("apiTest", "-PrunApiTests=true")
}
}
}

job("Tests for main branch") {
startOn {
gitPush {
Expand Down

0 comments on commit a383ebf

Please sign in to comment.