-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Publish build scans to develocity.scala-lang.org
- Loading branch information
Showing
10 changed files
with
66 additions
and
3 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import scala.util.Properties | ||
import sbt.url | ||
import java.net.URL | ||
|
||
|
||
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/variables#default-environment-variables | ||
object GithubEnv { | ||
lazy val repositoryVar: Option[(String, String)] = envVar("GITHUB_REPOSITORY") | ||
lazy val runIdVar: Option[(String, String)] = envVar("GITHUB_RUN_ID") | ||
lazy val shaVar: Option[(String, String)] = envVar("GITHUB_SHA") | ||
lazy val workflowVar: Option[(String, String)] = envVar("GITHUB_WORKFLOW") | ||
|
||
lazy val runUrl: Option[(String, URL)] = | ||
for { | ||
(_, repository) <- repositoryVar | ||
(_, runId) <- runIdVar | ||
} yield "GITHUB_RUN" -> url(s"https://github.com/$repository/actions/runs/$runId") | ||
lazy val treeUrl: Option[(String, URL)] = | ||
for { | ||
(_, repository) <- repositoryVar | ||
(_, sha) <- shaVar | ||
} yield "GITHUB_TREE" -> url(s"https://github.com/$repository/tree/$sha") | ||
|
||
|
||
def develocityValues: Seq[(String, String)] = repositoryVar.toSeq ++ shaVar ++ workflowVar | ||
def develocityLinks: Seq[(String, URL)] = runUrl.toSeq ++ treeUrl | ||
|
||
private def envVar(key: String): Option[(String, String)] = | ||
Properties.envOrNone(key).map(key -> _) | ||
} |
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