Skip to content

Commit

Permalink
Add Pipeline execution function that generates ARC-spec v2 draft comp…
Browse files Browse the repository at this point in the history
…liant output folder.
  • Loading branch information
kMutagene committed Feb 27, 2024
1 parent fc3f11f commit a1f83f3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ARCExpect/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.0.1 - (Released 2024-02-27)

Add Pipeline execution function that generates ARC-spec v2 draft compliant output folder.

### 1.0.0 - (Released 2024-01-12)

First release of ARCExpect API as a package. Initially, it was only used in the `arc-validate` CLI tool.
Expand Down
29 changes: 29 additions & 0 deletions src/ARCExpect/TopLevelAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

open AnyBadge.NET
open Expecto
open System.IO

type Execute =

Expand Down Expand Up @@ -48,5 +49,33 @@ type Execute =
results
|> Execute.JUnitSummaryCreation(jUnitPath)

results
|> Execute.BadgeCreation(badgePath, labelText, ?ValueSuffix = ValueSuffix, ?Thresholds = Thresholds, ?DefaultColor = DefaultColor)

static member ValidationPipeline(
basePath: string,
packageName: string,
?BadgeLabelText: string,
?ValueSuffix: string,
?Thresholds: Map<int, Color>,
?DefaultColor: Color
) =
fun (validationCases: Test) ->

let resultFolder = Path.Combine(basePath, ".arc-validate-results", packageName)
let badgePath = Path.Combine(resultFolder, "badge.svg")
let jUnitPath = Path.Combine(resultFolder, "validation_report.xml")

Directory.CreateDirectory(resultFolder) |> ignore

let results =
validationCases
|> Execute.Validation

results
|> Execute.JUnitSummaryCreation(jUnitPath)

let labelText = defaultArg BadgeLabelText packageName

results
|> Execute.BadgeCreation(badgePath, labelText, ?ValueSuffix = ValueSuffix, ?Thresholds = Thresholds, ?DefaultColor = DefaultColor)

0 comments on commit a1f83f3

Please sign in to comment.