-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2135 from ccellado/improve-ci
Fix ergo-core publishing in build.sbt
- Loading branch information
Showing
11 changed files
with
88 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,49 @@ jobs: | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
|
||
test_core: | ||
name: Run ergo-core tests and publish a ergo-core snapshot | ||
env: | ||
HAS_SECRETS: ${{ secrets.SONATYPE_PASSWORD != '' }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
scala: [2.13.12, 2.12.18, 2.11.12] | ||
java: [[email protected]] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout current branch (full) | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Java and Scala | ||
uses: olafurpg/setup-scala@v10 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: Cache sbt | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.sbt | ||
~/.ivy2/cache | ||
~/.coursier/cache/v1 | ||
~/.cache/coursier/v1 | ||
~/AppData/Local/Coursier/Cache/v1 | ||
~/Library/Caches/Coursier/v1 | ||
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | ||
|
||
- name: Runs ergo-core tests | ||
run: sbt ++${{ matrix.scala }} ergoCore/test | ||
|
||
- name: Publish a wallet snapshot ${{ github.ref }} | ||
if: env.HAS_SECRETS == 'true' | ||
run: sbt ++${{ matrix.scala }} ergoCore/publish | ||
env: | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
|
||
test_node: | ||
name: Run node tests | ||
strategy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
ergo-core/src/main/scala/org/ergoplatform/settings/ModifierIdReader.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package org.ergoplatform.settings | ||
|
||
import com.typesafe.config.Config | ||
import net.ceedubs.ficus.readers.ValueReader | ||
import scorex.util.ModifierId | ||
|
||
trait ModifierIdReader { | ||
|
||
implicit val modifierIdReader: ValueReader[ModifierId] = { (cfg, path) => | ||
ModifierId @@ cfg.getString(path) | ||
implicit val modifierIdReader: ValueReader[ModifierId] = new ValueReader[ModifierId] { | ||
override def read(cfg: Config, path: String): ModifierId = { | ||
ModifierId @@ cfg.getString(path) | ||
} | ||
} | ||
|
||
} |
27 changes: 14 additions & 13 deletions
27
ergo-core/src/main/scala/org/ergoplatform/settings/PowSchemeReaders.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package org.ergoplatform.settings | ||
|
||
import com.typesafe.config.ConfigException | ||
import com.typesafe.config.{Config, ConfigException} | ||
import net.ceedubs.ficus.Ficus._ | ||
import net.ceedubs.ficus.readers.ValueReader | ||
import org.ergoplatform.mining._ | ||
|
||
trait PowSchemeReaders { | ||
|
||
implicit val powSchemeReader: ValueReader[AutolykosPowScheme] = { (cfg, path) => | ||
val schemeNameKey = s"$path.powType" | ||
val schemeName = cfg.getString(schemeNameKey) | ||
val n = cfg.as[Int](s"$path.n") | ||
val k = cfg.as[Int](s"$path.k") | ||
if (schemeName == "autolykos") { | ||
new AutolykosPowScheme(k, n) | ||
} else if (schemeName == "fake") { | ||
new DefaultFakePowScheme(k, n) | ||
} else { | ||
throw new ConfigException.BadValue(schemeNameKey, schemeName) | ||
implicit val powSchemeReader: ValueReader[AutolykosPowScheme] = new ValueReader[AutolykosPowScheme] { | ||
override def read(cfg: Config, path: String): AutolykosPowScheme = { | ||
val schemeNameKey = s"$path.powType" | ||
val schemeName = cfg.getString(schemeNameKey) | ||
val n = cfg.as[Int](s"$path.n") | ||
val k = cfg.as[Int](s"$path.k") | ||
if (schemeName == "autolykos") { | ||
new AutolykosPowScheme(k, n) | ||
} else if (schemeName == "fake") { | ||
new DefaultFakePowScheme(k, n) | ||
} else { | ||
throw new ConfigException.BadValue(schemeNameKey, schemeName) | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters