From f842da99ebca9b6c0144f8a036dda14a8200833a Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 13:19:07 -0500 Subject: [PATCH 01/32] change checkout order --- .github/workflows/pr.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 29860310..ab740d66 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,6 +3,8 @@ name: .NET on: pull_request: branches: [ master ] + push: + jobs: build: @@ -13,11 +15,11 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] steps: + - uses: actions/checkout@v2 - uses: r-lib/actions/setup-R@v1 name: Setup R environment with: r-version: '4.1.1' - - uses: actions/checkout@v2 - name: Setup .NET uses: actions/setup-dotnet@v1 with: From 18e72563d4718c4f4738dfbcfb7ad05e8965a152 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 13:22:42 -0500 Subject: [PATCH 02/32] checkout@master --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ab740d66..98a37bc5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@master - uses: r-lib/actions/setup-R@v1 name: Setup R environment with: From a3c56479cc9908e0c7576283cea483ebc3318af9 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 13:23:31 -0500 Subject: [PATCH 03/32] capitalization --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 98a37bc5..e711eec3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@master - - uses: r-lib/actions/setup-R@v1 + - uses: r-lib/actions/setup-r@v1 name: Setup R environment with: r-version: '4.1.1' From 4e22a60118a342497dc1adf927c3e78c9c1cdde8 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 14:32:49 -0500 Subject: [PATCH 04/32] try set r home --- .github/workflows/pr.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e711eec3..1c1ecd46 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,9 +2,8 @@ name: .NET on: pull_request: - branches: [ master ] + branches: [ master ] push: - jobs: build: @@ -14,6 +13,8 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] + env: + R_HOME: /usr/local/bin/R steps: - uses: actions/checkout@master - uses: r-lib/actions/setup-r@v1 From 5b159086efb74a899de002bcbe9e5ed67d680e63 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 14:36:41 -0500 Subject: [PATCH 05/32] only mac CI --- .github/workflows/pr.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1c1ecd46..02054f29 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,10 +11,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [macos-latest] - env: - R_HOME: /usr/local/bin/R steps: - uses: actions/checkout@master - uses: r-lib/actions/setup-r@v1 From 580185b8a7650ff32e5837c4e5a62001d3ddbb17 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 14:49:16 -0500 Subject: [PATCH 06/32] print home --- .github/workflows/pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 02054f29..c32e5958 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -19,6 +19,10 @@ jobs: name: Setup R environment with: r-version: '4.1.1' + + - name: find home + run: | + R --print-home - name: Setup .NET uses: actions/setup-dotnet@v1 with: From 8c4af2f6de6f6b23da2c2410d25e85db4ff7d829 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 14:52:45 -0500 Subject: [PATCH 07/32] mac R_HOME in CI --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c32e5958..04c62a6e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,6 +13,8 @@ jobs: matrix: os: [macos-latest] + env: + R_HOME: /Library/Frameworks/R.framework/Resources steps: - uses: actions/checkout@master - uses: r-lib/actions/setup-r@v1 From 9750b4f73db3603e0315c3813eb11a76ee28e429 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 15:00:45 -0500 Subject: [PATCH 08/32] set R_HOME for mac in both pr and push --- .github/workflows/pr.yml | 2 +- .github/workflows/push.yml | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 04c62a6e..5f18a56d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,7 +3,6 @@ name: .NET on: pull_request: branches: [ master ] - push: jobs: build: @@ -15,6 +14,7 @@ jobs: env: R_HOME: /Library/Frameworks/R.framework/Resources + steps: - uses: actions/checkout@master - uses: r-lib/actions/setup-r@v1 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c12f740e..d36997d1 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,9 +9,17 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [macos-latest] + + env: + R_HOME: /Library/Frameworks/R.framework/Resources steps: + - uses: actions/checkout@master + - uses: r-lib/actions/setup-r@v1 + name: Setup R environment + with: + r-version: '4.1.1' - uses: actions/checkout@v2 - name: Setup .NET uses: actions/setup-dotnet@v1 @@ -34,3 +42,7 @@ jobs: publish_dir: ./output publish_branch: gh-pages force_orphan: true + - name: Examine bin + run: ls -r bin + - name: Publish NuGets (if this version not published before) + run: dotnet nuget push bin\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGETKEY }} --skip-duplicate \ No newline at end of file From 3f9fb71b6b2f93c6306a65b955a28d1266781db1 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 15:10:42 -0500 Subject: [PATCH 09/32] use target All on push --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d36997d1..58db5c62 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -34,7 +34,7 @@ jobs: - name: Restore dependencies run: dotnet restore RProvider.Tests.sln - name: Build - run: dotnet fake build -t Build + run: dotnet fake build -t All - name: Deploy documentation from master uses: peaceiris/actions-gh-pages@v3 with: From a231f04c343f46859f9b6763584e4cec6cc364d3 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 21:49:11 -0500 Subject: [PATCH 10/32] add back ubuntu and windows --- .github/workflows/pr.yml | 19 +++++++++++++++---- .github/workflows/push.yml | 19 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5f18a56d..c8e19879 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -9,13 +9,24 @@ jobs: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [macos-latest] - - env: - R_HOME: /Library/Frameworks/R.framework/Resources + os: [macos-latest,ubuntu-latest,windows-latest] steps: + - name: set mac R_HOME + if: matrix.os == 'macOS-latest' + run: echo "R_HOME=/Library/Frameworks/R.framework/Resources" >> $GITHUB_ENV + - name: set ubuntu R_HOME + if: matrix.os == 'ubuntu-latest' + run: echo "R_HOME=/usr/local/bin/R" >> $GITHUB_ENV + - name: set windows R_HOME + if: matrix.os == 'windows-latest' + run: echo "R_HOME=C:\R" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: verify R + run: | + Rscript -e '1+1' + echo "${{ env.R_HOME }}" - uses: actions/checkout@master - uses: r-lib/actions/setup-r@v1 name: Setup R environment diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 58db5c62..ea4019ff 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -8,13 +8,24 @@ jobs: build: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [macos-latest] - - env: - R_HOME: /Library/Frameworks/R.framework/Resources + os: [macos-latest,ubuntu-latest,windows-latest] steps: + - name: set mac R_HOME + if: matrix.os == 'macOS-latest' + run: echo "R_HOME=/Library/Frameworks/R.framework/Resources" >> $GITHUB_ENV + - name: set ubuntu R_HOME + if: matrix.os == 'ubuntu-latest' + run: echo "R_HOME=/usr/local/bin/R" >> $GITHUB_ENV + - name: set windows R_HOME + if: matrix.os == 'windows-latest' + run: echo "R_HOME=C:\R" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: verify R + run: | + Rscript -e '1+1' + echo "${{ env.R_HOME }}" - uses: actions/checkout@master - uses: r-lib/actions/setup-r@v1 name: Setup R environment From 2df575af8aa200df620cef150c34d6a75782bd96 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Wed, 15 Sep 2021 22:01:40 -0500 Subject: [PATCH 11/32] set timeout minutes --- .github/workflows/pr.yml | 1 + .github/workflows/push.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c8e19879..cb4bb6df 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,6 +8,7 @@ jobs: build: runs-on: ${{ matrix.os }} + timeout-minutes: 15 strategy: fail-fast: false matrix: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ea4019ff..d5fa9b61 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,6 +7,7 @@ on: jobs: build: runs-on: ${{ matrix.os }} + timeout-minutes: 15 strategy: fail-fast: false matrix: From 1ec922865df98894e61bd8c621a394f992ead041 Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Thu, 16 Sep 2021 17:26:02 +0100 Subject: [PATCH 12/32] Switch to dotnet pack from nuget.exe --- build.fsx | 121 +++++++++++++---------------------------- nuget/RProvider.nuspec | 38 ------------- nuget/publish.cmd | 1 - 3 files changed, 39 insertions(+), 121 deletions(-) delete mode 100644 nuget/RProvider.nuspec delete mode 100644 nuget/publish.cmd diff --git a/build.fsx b/build.fsx index 07d0c73f..e2e2d705 100644 --- a/build.fsx +++ b/build.fsx @@ -40,12 +40,13 @@ let projectDescription = """ The type provider automatically discovers available R packages and makes them easily accessible from F#, so you can easily call powerful packages and visualization libraries from code running on the .NET platform.""" -let authors = ["BlueMountain Capital"; "FsLab"] +let authors = "BlueMountain Capital;FsLab" let companyName = "BlueMountain Capital, FsLab" let tags = "F# fsharp R TypeProvider visualization statistics" -let gitHome = "https://github.com/fslaborg" -let gitName = "RProvider" +let packageProjectUrl = "https://fslaborg.org/RProvider/" +let repositoryType = "git" +let repositoryUrl = "https://github.com/fslaborg/RProvider" // -------------------------------------------------------------------------------------- // The rest of the code is standard F# build script @@ -97,16 +98,11 @@ Target.create "BuildTests" (fun _ -> // -------------------------------------------------------------------------------------- // Run the unit tests using test runner & kill test runner when complete - Target.create "RunTests" (fun _ -> Target.activateFinal "CloseTestRunner" Fake.DotNet.DotNet.test id (projectName + ".Tests.sln") ) -Target.createFinal "CloseTestRunner" (fun _ -> - Process.killAllByName "xunit.console.clr4.exe" -) - // -------------------------------------------------------------------------------------- // Build a NuGet package @@ -114,25 +110,36 @@ Target.create "NuGet" (fun _ -> // Format the description to fit on a single line (remove \r\n and double-spaces) let specificVersion (name, version) = name, sprintf "[%s]" version let projectDescription = projectDescription.Replace("\r", "").Replace("\n", "").Replace(" ", " ") - Fake.DotNet.NuGet.NuGet.NuGet (fun p -> + + // Format the release notes + let releaseNotes = release.Notes |> String.concat "\n" + + let properties = [ + ("Version", release.NugetVersion) + ("Authors", authors) + ("PackageProjectUrl", packageProjectUrl) + ("PackageTags", tags) + ("RepositoryType", repositoryType) + ("RepositoryUrl", repositoryUrl) + //("PackageLicenseExpression", license) // TODO Enable license after stop packing PipeMethodCalls + ("PackageReleaseNotes", releaseNotes) + ("Summary", projectSummary) + ("PackageDescription", projectDescription) + ("EnableSourceLink", "true") + ("PublishRepositoryUrl", "true") + ("EmbedUntrackedSources", "true") + //("IncludeSymbols", "true") //TODO Enable symbols + ("IncludeSymbols", "false") + ("SymbolPackageFormat", "snupkg") + ] + + DotNet.pack (fun p -> { p with - Authors = authors - Project = projectName - Summary = projectSummary - Description = projectDescription - Version = release.NugetVersion - ReleaseNotes = String.concat " " release.Notes - Tags = tags - OutputPath = "bin" - Dependencies = - [ "R.NET.Community", Fake.DotNet.NuGet.NuGet.GetPackageVersion "packages" "R.NET.Community" - "DynamicInterop", Fake.DotNet.NuGet.NuGet.GetPackageVersion "packages" "DynamicInterop" - "R.NET.Community.FSharp", Fake.DotNet.NuGet.NuGet.GetPackageVersion "packages" "R.NET.Community.FSharp" ] - |> List.map specificVersion - AccessKey = Fake.Core.Environment.environVarOrDefault "nugetkey" "" - Publish = Fake.Core.Environment.hasEnvironVar "nugetkey" }) - "nuget/RProvider.nuspec" -) + Configuration = DotNet.BuildConfiguration.Release + OutputPath = Some "bin" + MSBuildParams = { p.MSBuildParams with Properties = properties} + } + ) "src/RProvider/RProvider.fsproj") //-------------------------------------------------------------------------------------- //Generate the documentation @@ -142,65 +149,15 @@ Target.create "GenerateDocs" (fun _ -> DotNet.exec id "fsdocs" "build --clean" |> ignore ) -// -------------------------------------------------------------------------------------- -// Release Scripts - -Target.create "ReleaseDocs" (fun _ -> - Fake.Tools.Git.Repository.clone "" gitHome "temp/gh-pages" - Fake.Tools.Git.Branches.checkoutBranch "temp/gh-pages" "gh-pages" - Fake.IO.Shell.copyRecursive "output" "temp/gh-pages" true |> printfn "%A" - Fake.Tools.Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" "add ." |> printfn "%s" - let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" release.NugetVersion - Fake.Tools.Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s" - Fake.Tools.Git.Branches.push "temp/gh-pages" -) - -Target.create "ReleaseBinaries" (fun _ -> - Fake.Tools.Git.Repository.clone "" (gitHome + "/" + gitName + ".git") "temp/release" - Fake.Tools.Git.Branches.checkoutBranch "temp/release" "release" - Fake.IO.Shell.copyRecursive "bin" "temp/release" true |> printfn "%A" - let cmd = sprintf """commit -a -m "Update binaries for version %s""" release.NugetVersion - Fake.Tools.Git.CommandHelper.runSimpleGitCommand "temp/release" cmd |> printfn "%s" - Fake.Tools.Git.Branches.push "temp/release" -) - -Target.create "TagRelease" (fun _ -> - // Concatenate notes & create a tag in the local repository - let notes = (String.concat " " release.Notes).Replace("\n", ";").Replace("\r", "") - let tagName = "v" + release.NugetVersion - let cmd = sprintf """tag -a %s -m "%s" """ tagName notes - Fake.Tools.Git.CommandHelper.runSimpleGitCommand "." cmd |> printfn "%s" - - // Find the main remote (fslaborg GitHub) - let _, remotes, _ = Fake.Tools.Git.CommandHelper.runGitCommand "." "remote -v" - let main = remotes |> Seq.find (fun s -> s.Contains("(push)") && s.Contains("fslaborg/RProvider")) - let remoteName = main.Split('\t').[0] - Fake.Tools.Git.Branches.pushTag "." remoteName tagName -) - -Target.create "Release" ignore - // -------------------------------------------------------------------------------------- // Run all targets by default. Invoke 'build ' to override Target.create "All" ignore -Target.create "AllCore" ignore - -"Clean" - ==> "AssemblyInfo" - ==> "Build" - ==> "BuildTests" - ==> "RunTests" - ==> "All" - -"All" - ==> "CleanDocs" - ==> "GenerateDocs" - ==> "ReleaseDocs" - ==> "ReleaseBinaries" - ==> "Release" - -"All" ==> "NuGet" ==> "Release" -"All" ==> "TagRelease" ==> "Release" + +"Clean" ==> "AssemblyInfo" ==> "Build" +"Build" ==> "CleanDocs" ==> "GenerateDocs" ==> "All" +"Build" ==> "NuGet" ==> "All" +"Build" ==> "All" +"BuildTests" ==> "RunTests" ==> "All" Target.runOrDefault "All" diff --git a/nuget/RProvider.nuspec b/nuget/RProvider.nuspec deleted file mode 100644 index d95de3d7..00000000 --- a/nuget/RProvider.nuspec +++ /dev/null @@ -1,38 +0,0 @@ - - - - @project@ - @build.number@ - @authors@ - @authors@ - https://github.com/fslaborg/RProvider - https://github.com/fslaborg/RProvider/blob/master/LICENSE.md - https://raw.githubusercontent.com/fslaborg/RProvider/master/docs/files/misc/logo.png - @summary@ - @description@ - @releaseNotes@ - Copyright 2014 - @tags@ - en-US - @dependencies@ - - - - - - - - - - - - - - - - - - - - - diff --git a/nuget/publish.cmd b/nuget/publish.cmd deleted file mode 100644 index 4b92c714..00000000 --- a/nuget/publish.cmd +++ /dev/null @@ -1 +0,0 @@ -@for %%f in (..\bin\*.nupkg) do @..\packages\NuGet.CommandLine\tools\NuGet.exe push %%f From 00de6a1b42147cd22aea86f410e79618863af832 Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Thu, 16 Sep 2021 17:48:59 +0100 Subject: [PATCH 13/32] Reorder actions to use specific R version --- .github/workflows/pr.yml | 12 ++++++------ .github/workflows/push.yml | 24 +++++------------------- build.fsx | 1 - 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e0ee3810..e78ff166 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,6 +15,11 @@ jobs: os: [macos-latest,ubuntu-latest,windows-latest] steps: + - uses: actions/checkout@master + - uses: r-lib/actions/setup-r@v1 + name: Setup R environment + with: + r-version: '4.1.1' - name: Set R_HOME environment variable run: | if [ "$RUNNER_OS" == "Linux" ]; then @@ -32,12 +37,7 @@ jobs: run: | Rscript -e '1+1' echo "${{ env.R_HOME }}" - - uses: actions/checkout@master - - uses: r-lib/actions/setup-r@v1 - name: Setup R environment - with: - r-version: '4.1.1' - - name: find home + - name: Identify R Home run: | R --print-home - name: Setup .NET diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bc0e97b1..530487de 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -2,7 +2,7 @@ name: .NET on: push: - branches: [ master, fix-ci ] + branches: [ master ] jobs: build: @@ -14,29 +14,11 @@ jobs: os: [macos-latest] steps: - - name: set mac R_HOME - if: matrix.os == 'macOS-latest' - run: echo "R_HOME=/Library/Frameworks/R.framework/Resources" >> $GITHUB_ENV - - name: set ubuntu R_HOME - if: matrix.os == 'ubuntu-latest' - run: echo "R_HOME=/usr/local/bin/R" >> $GITHUB_ENV - - name: set windows R_HOME - if: matrix.os == 'windows-latest' - run: echo "R_HOME=C:\R" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: verify R - run: | - Rscript -e '1+1' - echo "${{ env.R_HOME }}" - uses: actions/checkout@master - uses: r-lib/actions/setup-r@v1 name: Setup R environment with: r-version: '4.1.1' - - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master - name: Setup R environment - with: - r-version: '4.1.1' - name: Set R_HOME environment variable run: | if [ "$RUNNER_OS" == "Linux" ]; then @@ -50,6 +32,10 @@ jobs: exit 1 fi shell: bash + - name: Verify R + run: | + Rscript -e '1+1' + echo "${{ env.R_HOME }}" - name: Setup .NET uses: actions/setup-dotnet@v1 with: diff --git a/build.fsx b/build.fsx index e2e2d705..3fb9092e 100644 --- a/build.fsx +++ b/build.fsx @@ -99,7 +99,6 @@ Target.create "BuildTests" (fun _ -> // Run the unit tests using test runner & kill test runner when complete Target.create "RunTests" (fun _ -> - Target.activateFinal "CloseTestRunner" Fake.DotNet.DotNet.test id (projectName + ".Tests.sln") ) From 0b9ffdaee0f18f8f4f4c2b5280e9ea6bee881eaf Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Thu, 16 Sep 2021 18:13:12 +0100 Subject: [PATCH 14/32] Use bash for R home identify step --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e78ff166..faf31ec4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -40,6 +40,7 @@ jobs: - name: Identify R Home run: | R --print-home + shell: bash - name: Setup .NET uses: actions/setup-dotnet@v1 with: From aab487803cee0e9d259ef269cc380399b8d5e946 Mon Sep 17 00:00:00 2001 From: nhirschey Date: Thu, 16 Sep 2021 14:18:12 -0500 Subject: [PATCH 15/32] use Rscript for cross-platform R.home() verification. --- .github/workflows/pr.yml | 8 ++------ .github/workflows/push.yml | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index faf31ec4..fe2c78bb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -33,14 +33,10 @@ jobs: exit 1 fi shell: bash - - name: Verify R + - name: Verify R Home run: | - Rscript -e '1+1' + Rscript -e 'R.home()' echo "${{ env.R_HOME }}" - - name: Identify R Home - run: | - R --print-home - shell: bash - name: Setup .NET uses: actions/setup-dotnet@v1 with: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 530487de..bcc111f8 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -32,9 +32,9 @@ jobs: exit 1 fi shell: bash - - name: Verify R + - name: Verify R Home run: | - Rscript -e '1+1' + Rscript -e 'R.home()' echo "${{ env.R_HOME }}" - name: Setup .NET uses: actions/setup-dotnet@v1 From bdbc9de2073b44d80caeb5a30ec8c2ca990849f1 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Sat, 18 Sep 2021 13:44:05 -0500 Subject: [PATCH 16/32] Add matrix type conversions --- src/RProvider.Runtime/RInterop.fs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/RProvider.Runtime/RInterop.fs b/src/RProvider.Runtime/RInterop.fs index 0e972e07..7544e32f 100644 --- a/src/RProvider.Runtime/RInterop.fs +++ b/src/RProvider.Runtime/RInterop.fs @@ -188,6 +188,10 @@ module internal RInteropInternal = | NumericVector(v) when at = typeof -> retype <| [ for n in v -> DateTime.FromOADate(n + RDateOffset) ] | NumericVector(v) when at = typeof -> retype <| [| for n in v -> DateTime.FromOADate(n + RDateOffset) |] | NumericVector(v) when at = typeof -> retype <| DateTime.FromOADate(v.Single() + RDateOffset) + | NumericMatrix(v) when at = typeof -> retype <| v.ToArray() + | CharacterMatrix(v) when at = typeof -> retype <| v.ToArray() + | IntegerMatrix(v) when at = typeof -> retype <| v.ToArray() + | LogicalMatrix(v) when at = typeof -> retype <| v.ToArray() // Empty vectors in R are represented as null | Null() when at = typeof -> retype <| List.empty | Null() when at = typeof -> retype <| Array.empty @@ -225,7 +229,12 @@ module internal RInteropInternal = | NumericVector(v) -> match v.GetAttribute("class") with | CharacterVector(cv) when cv.ToArray() = [| "Date" |] -> wrap <| [| for n in v -> DateTime.FromOADate(n + RDateOffset) |] - | _ -> wrap <| v.ToArray() + | _ -> wrap <| v.ToArray() + | CharacterMatrix(v) -> wrap <| v.ToArray() + | ComplexMatrix(v) -> wrap <| v.ToArray() + | IntegerMatrix(v) -> wrap <| v.ToArray() + | LogicalMatrix(v) -> wrap <| v.ToArray() + | NumericMatrix(v) -> wrap <| v.ToArray() | List(v) -> wrap <| v | Pairlist(pl) -> wrap <| (pl |> Seq.map (fun sym -> sym.PrintName, sym.AsSymbol().Value)) | Null() -> wrap <| null @@ -370,8 +379,8 @@ module RInterop = let getPackages() : string[] = Logging.logf "Communicating with R to get packages" - Logging.logf "Test: %O" (eval("1+4")) - Logging.logf "Test: %O" (eval("1+4").Value) + Logging.logf "Test: %A" (eval("1+4")) + Logging.logf "Test: %A" (eval("1+4").Value) eval(".packages(all.available=T)").GetValue() let getPackageDescription packageName: string = From 2ba7c99c7a83f0ac4f77c56401274db123ee41e9 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Sat, 18 Sep 2021 17:48:21 -0500 Subject: [PATCH 17/32] more logs --- src/RProvider.DesignTime/RData.fs | 17 +++++++++++++---- src/RProvider.DesignTime/RInteropClient.fs | 4 +++- src/RProvider.DesignTime/RProvider.fs | 1 + src/RProvider.Server/RInteropServer.fs | 2 ++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/RProvider.DesignTime/RData.fs b/src/RProvider.DesignTime/RData.fs index c3dc2f3d..51e8f374 100644 --- a/src/RProvider.DesignTime/RData.fs +++ b/src/RProvider.DesignTime/RData.fs @@ -5,6 +5,7 @@ open System.Reflection open ProviderImplementation.ProvidedTypes open Microsoft.FSharp.Core.CompilerServices open RProvider +open RProvider.Internal open Microsoft.FSharp.Quotations open PipeMethodCalls @@ -20,7 +21,7 @@ type public RDataProvider(cfg:TypeProviderConfig) as this = /// Given a file name, generate static type inherited from REnv let generateTypes asm typeName (args:obj[]) = - + Logging.logf $"Generating type for {typeName}" // Load the environment and generate the type let fileName = args.[0] :?> string let longFileName = @@ -50,6 +51,7 @@ type public RDataProvider(cfg:TypeProviderConfig) as this = // For each key in the environment, provide a property.. for name, typ in RInteropClient.getServer().InvokeAsync(fun s -> s.GetRDataSymbols(longFileName)) |> Async.AwaitTask |> Async.RunSynchronously do + Logging.logf $"Adding member {name}" match typ with | null -> // Generate property of type 'SymbolicExpression' @@ -63,7 +65,8 @@ type public RDataProvider(cfg:TypeProviderConfig) as this = ProvidedProperty(name, typ, getterCode = fun (Singleton self) -> Expr.Coerce(<@@ ((%%self):REnv).Get(name).Value @@>, typ)) |> resTy.AddMember - + + Logging.logf $"Finished generating types for {longFileName}" resTy // Register the main (parameterized) type with F# compiler @@ -77,5 +80,11 @@ type public RDataProvider(cfg:TypeProviderConfig) as this = let rdata = ProvidedTypeDefinition(asm, "RProvider", "RData", Some(typeof)) let parameter = ProvidedStaticParameter("FileName", typeof) - do rdata.DefineStaticParameters([parameter], generateTypes asm) - do this.AddNamespace("RProvider", [ rdata ]) + do + rdata.DefineStaticParameters([parameter], generateTypes asm) + Logging.logf $"Defined static Parameters {parameter}" + do + this.AddNamespace("RProvider", [ rdata ]) + Logging.logf $"RData added namespace {rdata.FullName}" + + diff --git a/src/RProvider.DesignTime/RInteropClient.fs b/src/RProvider.DesignTime/RInteropClient.fs index a428ed87..e49efc3e 100644 --- a/src/RProvider.DesignTime/RInteropClient.fs +++ b/src/RProvider.DesignTime/RInteropClient.fs @@ -110,7 +110,9 @@ let getServer() = lock serverLock (fun () -> Logging.logf "[Check last server]" match lastServer with - | Some s -> s + | Some s -> + Logging.logf "[Found lastServer]" + s | None -> Logging.logf "[Make new server]" // TODO Remove RunSynchronously diff --git a/src/RProvider.DesignTime/RProvider.fs b/src/RProvider.DesignTime/RProvider.fs index 6e3417f4..b2d9c35d 100644 --- a/src/RProvider.DesignTime/RProvider.fs +++ b/src/RProvider.DesignTime/RProvider.fs @@ -37,6 +37,7 @@ type public RProvider(cfg:TypeProviderConfig) as this = try for ns, types in RTypeBuilder.initAndGenerate(runtimeAssembly) do this.AddNamespace(ns, types) + Logging.logf $"RProvider constructor succeeded" with e -> Logging.logf $"RProvider constructor failed: {e}" reraise() diff --git a/src/RProvider.Server/RInteropServer.fs b/src/RProvider.Server/RInteropServer.fs index 127f21e8..83dc0c48 100644 --- a/src/RProvider.Server/RInteropServer.fs +++ b/src/RProvider.Server/RInteropServer.fs @@ -107,7 +107,9 @@ type RInteropServer() = EventLoop.runServerCommandSafe <| fun () -> let env = REnv(file) [| for k in env.Keys -> + Logging.logf $"GetRDataSymbols: key={k}" let v = env.Get(k) + Logging.logf $"GetRDataSymbols: value=%O{(v.Value)}" let typ = try v.Value.GetType() with _ -> null k, typ |] From 843cc7ef403d752a665a2e0c77b7fb256064ee0c Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Sat, 18 Sep 2021 17:54:00 -0500 Subject: [PATCH 18/32] try add r log to pr CI --- .github/workflows/pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fe2c78bb..8d0e99a5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,6 +13,8 @@ jobs: fail-fast: false matrix: os: [macos-latest,ubuntu-latest,windows-latest] + env: + RPROVIDER_LOG=rlog.txt steps: - uses: actions/checkout@master @@ -51,3 +53,5 @@ jobs: run: dotnet restore RProvider.Tests.sln - name: Build run: dotnet fake build -t All + - name: Check R log + run: cat rlog.txt From dc0b8fd3426991ff344ae197ec58d337394c9889 Mon Sep 17 00:00:00 2001 From: Nicholas Hirschey Date: Sat, 18 Sep 2021 18:37:14 -0500 Subject: [PATCH 19/32] Fix RProvider_LOG env variable --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8d0e99a5..b1893a54 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [macos-latest,ubuntu-latest,windows-latest] env: - RPROVIDER_LOG=rlog.txt + RPROVIDER_LOG: rlog.txt steps: - uses: actions/checkout@master From 9940f4d1a5ede449b0af225a75086cf1f501f6be Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Sun, 19 Sep 2021 23:13:30 +0100 Subject: [PATCH 20/32] Update paket.dependencies Use a version of PipeMethodCalls that doesn't pack on build --- paket.dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paket.dependencies b/paket.dependencies index 663c7038..3dcdf206 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -18,7 +18,7 @@ nuget R.NET.FSharp 1.9.0 nuget System.ComponentModel.Composition 5.0.0 nuget System.Configuration.ConfigurationManager 5.0.0 nuget System.Reflection.MetadataLoadContext 5.0.0 -github andrewiom/PipeMethodCalls:69e5b6f7c1a130e20a2b8023638f6d6d65390b55 +github andrewiom/PipeMethodCalls:7306482212444920ff07b0c5db5f2e71a4077bdf github fsprojects/FSharp.TypeProviders.SDK:f4aca36af04aa84b16ec04df6f6bf55ac2f17a73 src/ProvidedTypes.fsi github fsprojects/FSharp.TypeProviders.SDK:f4aca36af04aa84b16ec04df6f6bf55ac2f17a73 src/ProvidedTypes.fs From 3ccfaa290073f1f1b75ff7f71a7b1b4fe7998688 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Sun, 19 Sep 2021 23:14:22 +0100 Subject: [PATCH 21/32] Detect process exit on windows Stops infinite hangs when the process has exited --- src/RProvider.Server/Program.fs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/RProvider.Server/Program.fs b/src/RProvider.Server/Program.fs index e80e146f..04d9f983 100644 --- a/src/RProvider.Server/Program.fs +++ b/src/RProvider.Server/Program.fs @@ -12,7 +12,13 @@ open RProvider.Runtime.Serialisation /// Process.WaitForExit does not seem to be working reliably /// on Mono, so instead we loop asynchronously until the process is gone let rec asyncWaitForExit pid = async { - let parentProcess = try Process.GetProcessById(pid) |> Some with _ -> None + let parentProcess = + try + let p = Process.GetProcessById(pid) + match p.HasExited with + | true -> None + | false -> Some p + with _ -> None match parentProcess with | Some _ -> do! Async.Sleep(1000) From bbf941b913c786f95800ea5e952440db8b4f7432 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 20 Sep 2021 00:23:57 +0100 Subject: [PATCH 22/32] Use simple dotnet exec Try to see if options passed by FAKE cause test instability --- build.fsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.fsx b/build.fsx index 3fb9092e..d5d9ca81 100644 --- a/build.fsx +++ b/build.fsx @@ -99,7 +99,10 @@ Target.create "BuildTests" (fun _ -> // Run the unit tests using test runner & kill test runner when complete Target.create "RunTests" (fun _ -> - Fake.DotNet.DotNet.test id (projectName + ".Tests.sln") + let rHome = Environment.environVarOrFail "R_HOME" + Trace.logf "R_HOME is set as %s" rHome + let result = Fake.DotNet.DotNet.exec id "test" (projectName + ".Tests.sln") + if result.ExitCode <> 0 then failwith "Tests failed" ) // -------------------------------------------------------------------------------------- From d0023f5308fd9e38083444bc1f4099774c59f301 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 20 Sep 2021 00:43:22 +0100 Subject: [PATCH 23/32] Update paket.lock --- paket.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paket.lock b/paket.lock index 32495297..901f2e61 100644 --- a/paket.lock +++ b/paket.lock @@ -588,7 +588,7 @@ NUGET xunit.runner.visualstudio (2.4.3) GITHUB remote: andrewiom/PipeMethodCalls - FULLPROJECT (69e5b6f7c1a130e20a2b8023638f6d6d65390b55) + FULLPROJECT (7306482212444920ff07b0c5db5f2e71a4077bdf) remote: fsprojects/FSharp.TypeProviders.SDK src/ProvidedTypes.fs (f4aca36af04aa84b16ec04df6f6bf55ac2f17a73) src/ProvidedTypes.fsi (f4aca36af04aa84b16ec04df6f6bf55ac2f17a73) From 993061ed85a317505bd59de3d57dfe80686f37fc Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Mon, 20 Sep 2021 10:07:02 +0100 Subject: [PATCH 24/32] Always output CI logs --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b1893a54..1aaa0ad9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -54,4 +54,5 @@ jobs: - name: Build run: dotnet fake build -t All - name: Check R log + if: ${{ always() }} run: cat rlog.txt From 8fac6310e27a65ab86c1eb16e0ce40728a2b8112 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 20 Sep 2021 12:32:37 +0100 Subject: [PATCH 25/32] Update build.fsx Change build order and enable more verbose logging for tests --- build.fsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.fsx b/build.fsx index d5d9ca81..519561ce 100644 --- a/build.fsx +++ b/build.fsx @@ -101,7 +101,8 @@ Target.create "BuildTests" (fun _ -> Target.create "RunTests" (fun _ -> let rHome = Environment.environVarOrFail "R_HOME" Trace.logf "R_HOME is set as %s" rHome - let result = Fake.DotNet.DotNet.exec id "test" (projectName + ".Tests.sln") + let result = Fake.DotNet.DotNet.exec (fun args -> + { args with Verbosity = Some Fake.DotNet.DotNet.Verbosity.Normal}) "test" (projectName + ".Tests.sln") if result.ExitCode <> 0 then failwith "Tests failed" ) @@ -160,6 +161,6 @@ Target.create "All" ignore "Build" ==> "CleanDocs" ==> "GenerateDocs" ==> "All" "Build" ==> "NuGet" ==> "All" "Build" ==> "All" -"BuildTests" ==> "RunTests" ==> "All" +"Build" ==> "BuildTests" ==> "RunTests" ==> "All" Target.runOrDefault "All" From 638315f1d65c3b1ebc279254af5034957e15f5a5 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 20 Sep 2021 12:55:31 +0100 Subject: [PATCH 26/32] Use R 4.0.2 in CI --- .github/workflows/pr.yml | 2 +- .github/workflows/push.yml | 2 +- build.fsx | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1aaa0ad9..68290f55 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -21,7 +21,7 @@ jobs: - uses: r-lib/actions/setup-r@v1 name: Setup R environment with: - r-version: '4.1.1' + r-version: '4.0.2' - name: Set R_HOME environment variable run: | if [ "$RUNNER_OS" == "Linux" ]; then diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bcc111f8..23297c48 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -18,7 +18,7 @@ jobs: - uses: r-lib/actions/setup-r@v1 name: Setup R environment with: - r-version: '4.1.1' + r-version: '4.0.2' - name: Set R_HOME environment variable run: | if [ "$RUNNER_OS" == "Linux" ]; then diff --git a/build.fsx b/build.fsx index 519561ce..69cb9104 100644 --- a/build.fsx +++ b/build.fsx @@ -92,7 +92,10 @@ Target.create "Build" (fun _ -> Target.create "BuildTests" (fun _ -> Trace.log " --- Building tests --- " - Fake.DotNet.DotNet.build id (projectName + ".Tests.sln") + //Fake.DotNet.DotNet.build id (projectName + ".Tests.sln") + let result = Fake.DotNet.DotNet.exec (fun args -> + { args with Verbosity = Some Fake.DotNet.DotNet.Verbosity.Normal}) "build" (projectName + ".Tests.sln") + if result.ExitCode <> 0 then failwith "Building tests failed" ) // -------------------------------------------------------------------------------------- From d316944613e90f73db666463e53d3f96fb5fb346 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 20 Sep 2021 13:09:53 +0100 Subject: [PATCH 27/32] Disable test parallelism --- tests/Test.RProvider/Test.fs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Test.RProvider/Test.fs b/tests/Test.RProvider/Test.fs index 86225138..ae67419a 100644 --- a/tests/Test.RProvider/Test.fs +++ b/tests/Test.RProvider/Test.fs @@ -21,6 +21,9 @@ open FsCheck.Xunit open System.Numerics open System.Text +[] +do() + // Generic function to test that a value round-trips // when SEXP is asked for the value by-type let testRoundTrip (x: 'a) (typeof: SymbolicExpressionType) (clsName: Option) = From 294893c5e920a8ca5c473a5e4f17342f454e6d6c Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Mon, 20 Sep 2021 14:18:07 +0100 Subject: [PATCH 28/32] Testing process.hasexited in github actions --- src/RProvider.Server/Program.fs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/RProvider.Server/Program.fs b/src/RProvider.Server/Program.fs index 04d9f983..81ab9ed6 100644 --- a/src/RProvider.Server/Program.fs +++ b/src/RProvider.Server/Program.fs @@ -12,18 +12,21 @@ open RProvider.Runtime.Serialisation /// Process.WaitForExit does not seem to be working reliably /// on Mono, so instead we loop asynchronously until the process is gone let rec asyncWaitForExit pid = async { - let parentProcess = - try - let p = Process.GetProcessById(pid) - match p.HasExited with - | true -> None - | false -> Some p - with _ -> None - match parentProcess with - | Some _ -> - do! Async.Sleep(1000) - return! asyncWaitForExit pid - | None -> () } + do! Async.Sleep(30000) + () + } + // let parentProcess = + // try + // let p = Process.GetProcessById(pid) + // match p.HasExited with + // | true -> None + // | false -> Some p + // with _ -> None + // match parentProcess with + // | Some _ -> + // do! Async.Sleep(1000) + // return! asyncWaitForExit pid + // | None -> () } /// Start the server using the specified channel name (which /// contains the parent PID) and delete tempFile once we're running From 8c62df946b905dd32ba8b8fa0b0295113bf9ff27 Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Mon, 20 Sep 2021 14:25:30 +0100 Subject: [PATCH 29/32] Revert program.fs Remove the test. Process.HasExisted doesn't appear to be the issue in Github Actions... --- src/RProvider.Server/Program.fs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/RProvider.Server/Program.fs b/src/RProvider.Server/Program.fs index 81ab9ed6..04d9f983 100644 --- a/src/RProvider.Server/Program.fs +++ b/src/RProvider.Server/Program.fs @@ -12,21 +12,18 @@ open RProvider.Runtime.Serialisation /// Process.WaitForExit does not seem to be working reliably /// on Mono, so instead we loop asynchronously until the process is gone let rec asyncWaitForExit pid = async { - do! Async.Sleep(30000) - () - } - // let parentProcess = - // try - // let p = Process.GetProcessById(pid) - // match p.HasExited with - // | true -> None - // | false -> Some p - // with _ -> None - // match parentProcess with - // | Some _ -> - // do! Async.Sleep(1000) - // return! asyncWaitForExit pid - // | None -> () } + let parentProcess = + try + let p = Process.GetProcessById(pid) + match p.HasExited with + | true -> None + | false -> Some p + with _ -> None + match parentProcess with + | Some _ -> + do! Async.Sleep(1000) + return! asyncWaitForExit pid + | None -> () } /// Start the server using the specified channel name (which /// contains the parent PID) and delete tempFile once we're running From 870db5996a13b46ee1fc304b41525fb137945938 Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Mon, 20 Sep 2021 14:27:18 +0100 Subject: [PATCH 30/32] Test 2: Remove RData tests Testing Github Actions stalling on Ubuntu 20.04 --- tests/Test.RProvider/RData.Tests.fs | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/Test.RProvider/RData.Tests.fs b/tests/Test.RProvider/RData.Tests.fs index d1d9a747..0bd564a7 100644 --- a/tests/Test.RProvider/RData.Tests.fs +++ b/tests/Test.RProvider/RData.Tests.fs @@ -12,26 +12,26 @@ open Xunit open System open RProvider -type Sample = RData<"data/sample.rdata"> +// type Sample = RData<"data/sample.rdata"> -[] -let ``Can read sample RData file`` () = - let sample = Sample() - let sum = sample.volcanoList |> Array.sum - Assert.Equal<_>(sum, 690907.0) - Assert.Equal<_>(int sample.volcanoMean.[0], 130) +// [] +// let ``Can read sample RData file`` () = +// let sample = Sample() +// let sum = sample.volcanoList |> Array.sum +// Assert.Equal<_>(sum, 690907.0) +// Assert.Equal<_>(int sample.volcanoMean.[0], 130) -[] -let ``Can save RData file and read it from a temp path`` () = - let volcanoList = [| 3.0; 1.0 |] - let volcanoMean = [| 2.0 |] +// [] +// let ``Can save RData file and read it from a temp path`` () = +// let volcanoList = [| 3.0; 1.0 |] +// let volcanoMean = [| 2.0 |] - let temp = IO.Path.GetTempFileName() + ".rdata" - R.assign("volcanoList", volcanoList) |> ignore - R.assign("volcanoMean", volcanoMean) |> ignore - R.save(list=[ "volcanoList"; "volcanoMean" ], file=temp) |> ignore +// let temp = IO.Path.GetTempFileName() + ".rdata" +// R.assign("volcanoList", volcanoList) |> ignore +// R.assign("volcanoMean", volcanoMean) |> ignore +// R.save(list=[ "volcanoList"; "volcanoMean" ], file=temp) |> ignore - let sample = Sample(temp) - Assert.Equal<_>(sample.volcanoList |> Array.sum, 4.0) - Assert.Equal<_>(int sample.volcanoMean.[0], 2) +// let sample = Sample(temp) +// Assert.Equal<_>(sample.volcanoList |> Array.sum, 4.0) +// Assert.Equal<_>(int sample.volcanoMean.[0], 2) From bbab96ad1f525b68db6229ec602cb9e53a6d04b1 Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Mon, 20 Sep 2021 14:32:22 +0100 Subject: [PATCH 31/32] Revert RData.Tests.fs Not that either... --- tests/Test.RProvider/RData.Tests.fs | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/Test.RProvider/RData.Tests.fs b/tests/Test.RProvider/RData.Tests.fs index 0bd564a7..d1d9a747 100644 --- a/tests/Test.RProvider/RData.Tests.fs +++ b/tests/Test.RProvider/RData.Tests.fs @@ -12,26 +12,26 @@ open Xunit open System open RProvider -// type Sample = RData<"data/sample.rdata"> +type Sample = RData<"data/sample.rdata"> -// [] -// let ``Can read sample RData file`` () = -// let sample = Sample() -// let sum = sample.volcanoList |> Array.sum -// Assert.Equal<_>(sum, 690907.0) -// Assert.Equal<_>(int sample.volcanoMean.[0], 130) +[] +let ``Can read sample RData file`` () = + let sample = Sample() + let sum = sample.volcanoList |> Array.sum + Assert.Equal<_>(sum, 690907.0) + Assert.Equal<_>(int sample.volcanoMean.[0], 130) -// [] -// let ``Can save RData file and read it from a temp path`` () = -// let volcanoList = [| 3.0; 1.0 |] -// let volcanoMean = [| 2.0 |] +[] +let ``Can save RData file and read it from a temp path`` () = + let volcanoList = [| 3.0; 1.0 |] + let volcanoMean = [| 2.0 |] -// let temp = IO.Path.GetTempFileName() + ".rdata" -// R.assign("volcanoList", volcanoList) |> ignore -// R.assign("volcanoMean", volcanoMean) |> ignore -// R.save(list=[ "volcanoList"; "volcanoMean" ], file=temp) |> ignore + let temp = IO.Path.GetTempFileName() + ".rdata" + R.assign("volcanoList", volcanoList) |> ignore + R.assign("volcanoMean", volcanoMean) |> ignore + R.save(list=[ "volcanoList"; "volcanoMean" ], file=temp) |> ignore -// let sample = Sample(temp) -// Assert.Equal<_>(sample.volcanoList |> Array.sum, 4.0) -// Assert.Equal<_>(int sample.volcanoMean.[0], 2) + let sample = Sample(temp) + Assert.Equal<_>(sample.volcanoList |> Array.sum, 4.0) + Assert.Equal<_>(int sample.volcanoMean.[0], 2) From 080284fad1e8038eb9646da56a247b1ae16419a4 Mon Sep 17 00:00:00 2001 From: AndrewIOM Date: Mon, 20 Sep 2021 23:07:38 +0100 Subject: [PATCH 32/32] Disable Ubuntu CI for now --- .github/workflows/pr.yml | 2 +- .github/workflows/push.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 68290f55..dbea0cc1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest,ubuntu-latest,windows-latest] + os: [macos-latest,windows-latest] env: RPROVIDER_LOG: rlog.txt diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 23297c48..4a8ffc47 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest] + os: [macos-latest,windows-latest] steps: - uses: actions/checkout@master