Skip to content

Commit

Permalink
Init ArcPrototype submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Sep 4, 2024
1 parent 3294df8 commit 98351f5
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 23 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,10 @@ on:
- '.github/**'

jobs:
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x
- name: test
working-directory: ./
run: dotnet test

test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x
- name: test
working-directory: ./
run: dotnet test
build-and-test:
name: "Build and test"
uses: nfdi4plants/actions-workflows/.github/workflows/build-and-test-solution.yml@main
with:
solution: ./arc-validation-packages.sln
checkout-submodules: true
configuration: Release
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ArcPrototype"]
path = tests/fixtures/ArcPrototype
url = https://git.nfdi4plants.org/muehlhaus/ArcPrototype.git
File renamed without changes.
12 changes: 12 additions & 0 deletions tests/GitSubmodulesTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module GitSubmoduleTests

open System
open System.IO
open Xunit

[<Fact>]
let ``ArcPrototype commit hash is correct`` () =
Assert.Equal(
ReferenceObjects.expected_prototype_commit_hash,
TestObjects.prototypeCommitHash
)
5 changes: 5 additions & 0 deletions tests/ReferenceObjects.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module ReferenceObjects

open System.IO

let expected_prototype_commit_hash = "2635598d9ea365c7ce545a9f279cca39af3de5df"
5 changes: 5 additions & 0 deletions tests/TestObjects.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module TestObjects

let prototypeCommitHashOutput = TestUtils.getCommitHash "../../../fixtures/ArcPrototype"

let prototypeCommitHash = prototypeCommitHashOutput.Result.Output.TrimStart().TrimEnd()
16 changes: 16 additions & 0 deletions tests/TestUtils.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module TestUtils

open System
open System.IO
open type System.Environment
open Fake.Core

let runTool (tool: string) (args: string []) (dir:string) =
CreateProcess.fromRawCommand tool args
|> CreateProcess.withWorkingDirectory dir
|> CreateProcess.redirectOutput
|> Proc.run

let getCommitHash path =
let output = runTool "git" [|"rev-parse"; "HEAD"|] path
output
5 changes: 5 additions & 0 deletions tests/ValidationPackages.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
<ItemGroup>
<None Include="fixtures\**" CopyToOutputDirectory="Always" />
<Content Include="..\validation_packages\**" CopyToOutputDirectory="Always" LinkBase="validation_packages" />
<Compile Include="TestUtils.fs" />
<Compile Include="ReferenceObjects.fs" />
<Compile Include="TestObjects.fs" />
<Compile Include="GitSubmodulesTests.fs" />
<Compile Include="Tests.fs" />
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fake.Core.Process" Version="6.0.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/ArcPrototype
Submodule ArcPrototype added at 263559

0 comments on commit 98351f5

Please sign in to comment.