Make CI builds reproducible

This commit is contained in:
vvb2060 2022-06-20 05:34:13 +08:00 committed by John Wu
parent b68658e974
commit 0beb3bf16a

View File

@ -11,7 +11,8 @@ import javax.crypto.spec.SecretKeySpec
import kotlin.random.asKotlinRandom import kotlin.random.asKotlinRandom
// Set non-zero value here to fix the random seed for reproducible builds // Set non-zero value here to fix the random seed for reproducible builds
const val RAND_SEED = 0 // CI builds are always reproducible
val RAND_SEED = if (System.getenv("CI") != null) 42 else 0
private lateinit var RANDOM: Random private lateinit var RANDOM: Random
private val kRANDOM get() = RANDOM.asKotlinRandom() private val kRANDOM get() = RANDOM.asKotlinRandom()