mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 00:47:26 -04:00
minosoft ci: cache integration test assets
This commit is contained in:
parent
901de32766
commit
00e239527f
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -40,6 +40,12 @@ jobs:
|
||||
path: ~/.gradle/wrapper
|
||||
key: ${{ matrix.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
|
||||
- name: Setup Gradle Wrapper Cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ./it
|
||||
key: minosoft-assets
|
||||
|
||||
- name: Build
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,3 +9,5 @@ hs_err_pid*.log
|
||||
|
||||
# Ignore Gradle build output directory
|
||||
build
|
||||
|
||||
it/
|
||||
|
@ -29,6 +29,10 @@ cache:
|
||||
- "gradle/wrapper/gradle-wrapper.properties"
|
||||
paths:
|
||||
- .gradle_home/wrapper
|
||||
- key:
|
||||
"minosoft-assets"
|
||||
paths:
|
||||
- ./it
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -38,7 +38,7 @@ internal object MinosoftSIT {
|
||||
Log.ASYNC_LOGGING = false
|
||||
RunConfiguration.VERBOSE_LOGGING = true
|
||||
RunConfiguration.APPLICATION_NAME = "Minosoft it"
|
||||
RunConfiguration::HOME_DIRECTORY.forceSet(Path.of(System.getProperty("java.io.tmpdir"), "minosoft"))
|
||||
RunConfiguration::HOME_DIRECTORY.forceSet(Path.of("./it"))
|
||||
RunConfiguration::CONFIG_DIRECTORY.forceSet(Path.of(System.getProperty("java.io.tmpdir"), "minosoft").resolve("conf"))
|
||||
RunConfiguration.PROFILES_HOT_RELOADING = false
|
||||
}
|
||||
|
@ -179,16 +179,20 @@ abstract class StorageProfileManager<P : Profile> : Iterable<P>, Identified {
|
||||
profile.lock.lock()
|
||||
storage.updating = true
|
||||
|
||||
unsafeUpdate(profile, data)
|
||||
|
||||
storage.updating = false
|
||||
// storage.invalid = false
|
||||
profile.lock.unlock()
|
||||
}
|
||||
|
||||
fun unsafeUpdate(profile: P, data: ObjectNode) {
|
||||
val injectable = InjectableValues.Std()
|
||||
injectable.addValue(type.clazz, profile)
|
||||
reader
|
||||
.withValueToUpdate(profile)
|
||||
.with(injectable)
|
||||
.readValue<P>(data)
|
||||
|
||||
storage.updating = false
|
||||
// storage.invalid = false
|
||||
profile.lock.unlock()
|
||||
}
|
||||
|
||||
fun create(name: String): P {
|
||||
@ -212,16 +216,17 @@ abstract class StorageProfileManager<P : Profile> : Iterable<P>, Identified {
|
||||
|
||||
Log.log(LogMessageType.PROFILES, LogLevels.VERBOSE) { "Saving profile to $path" }
|
||||
profile.lock.acquire()
|
||||
storage.invalid = false // do it before actually saving it. If the data changes while writing it gets saved another time
|
||||
storage.saved++
|
||||
|
||||
val node = Jackson.MAPPER.valueToTree<ObjectNode>(profile) // TODO: cache jacksonType
|
||||
node.put(VERSION, latestVersion)
|
||||
val string = Jackson.MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(node)
|
||||
|
||||
val stream = FileOutputStream(path)
|
||||
stream.write(string.encodeNetwork())
|
||||
stream.close()
|
||||
|
||||
storage.invalid = false
|
||||
|
||||
profile.lock.release()
|
||||
}
|
||||
|
||||
@ -250,7 +255,7 @@ abstract class StorageProfileManager<P : Profile> : Iterable<P>, Identified {
|
||||
}
|
||||
|
||||
fun init() {
|
||||
reader
|
||||
reader // init lazy value
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
Loading…
x
Reference in New Issue
Block a user