summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-02-11 14:10:58 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-02-11 14:20:49 +0100
commitf7026349d3a9cb4e3c02c7f46d4c593e78132e75 (patch)
tree18e26e73a3d4519b8352a17ae47c52ce8a75245a
parent878990c8e230a43b534fc8e870f59630152fb6bf (diff)
chore: Add support for Gitlab CI
This change adds the configuration of Gitlab CI in order to test on our internal Gitlab instance.
-rw-r--r--.gitlab-ci.yml34
-rw-r--r--odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt21
-rw-r--r--odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngineProvider.kt2
3 files changed, 45 insertions, 12 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..a095f7e7
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,34 @@
+image: gradle:6.1-jdk13
+
+variables:
+ GRADLE_OPTS: "-Dorg.gradle.daemon=false"
+
+before_script:
+ - export GRADLE_USER_HOME=`pwd`/.gradle
+
+stages:
+ - build
+ - test
+
+build:
+ stage: build
+ script:
+ - gradle --build-cache assemble
+ allow_failure: false
+ cache:
+ key: "$CI_COMMIT_REF_NAME"
+ policy: push
+ paths:
+ - build
+ - .gradle
+
+test:
+ stage: test
+ script:
+ - gradle check
+ cache:
+ key: "$CI_COMMIT_REF_NAME"
+ policy: pull
+ paths:
+ - build
+ - .gradle
diff --git a/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt b/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt
index 15d3bd88..34e5fd9a 100644
--- a/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt
+++ b/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt
@@ -24,7 +24,6 @@
package com.atlarge.odcsim.engine.omega
-import com.atlarge.odcsim.SimulationEngine
import com.atlarge.odcsim.Behavior
import com.atlarge.odcsim.Channel
import com.atlarge.odcsim.ProcessContext
@@ -33,6 +32,16 @@ import com.atlarge.odcsim.ReceivePort
import com.atlarge.odcsim.ReceiveRef
import com.atlarge.odcsim.SendPort
import com.atlarge.odcsim.SendRef
+import com.atlarge.odcsim.SimulationEngine
+import java.time.Clock
+import java.time.Instant
+import java.time.ZoneId
+import java.util.PriorityQueue
+import java.util.UUID
+import kotlin.coroutines.Continuation
+import kotlin.coroutines.CoroutineContext
+import kotlin.coroutines.coroutineContext
+import kotlin.coroutines.startCoroutine
import kotlinx.coroutines.CancellableContinuation
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Delay
@@ -43,15 +52,6 @@ import kotlinx.coroutines.channels.Channel as KChannel
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.SelectClause1
import org.jetbrains.annotations.Async
-import java.time.Clock
-import java.time.Instant
-import java.time.ZoneId
-import java.util.PriorityQueue
-import java.util.UUID
-import kotlin.coroutines.Continuation
-import kotlin.coroutines.CoroutineContext
-import kotlin.coroutines.coroutineContext
-import kotlin.coroutines.startCoroutine
/**
* The reference implementation of the [SimulationEngine] instance for the OpenDC simulation core.
@@ -277,7 +277,6 @@ class OmegaSimulationEngine(rootBehavior: Behavior, override val name: String) :
check(!closed) { "Port is closed" }
schedule(Event.Send(clock.time, channelImpl, message))
}
-
}
private class ReceivePortImpl<T : Any>(private val channel: ChannelImpl<T>) : ReceivePort<T> {
diff --git a/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngineProvider.kt b/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngineProvider.kt
index b9a1c30f..75bb2265 100644
--- a/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngineProvider.kt
+++ b/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngineProvider.kt
@@ -24,9 +24,9 @@
package com.atlarge.odcsim.engine.omega
+import com.atlarge.odcsim.Behavior
import com.atlarge.odcsim.SimulationEngine
import com.atlarge.odcsim.SimulationEngineProvider
-import com.atlarge.odcsim.Behavior
import java.util.ServiceLoader
/**