Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #22 C# gha workflow #143

Merged
merged 54 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
403455a
temporarly disable R workflows
Felixmil Apr 25, 2024
011638b
add draft workflow for building/testing/commiting binaries
Felixmil Apr 25, 2024
209b1d0
fix name
Felixmil Apr 25, 2024
f7407f5
fix yaml
Felixmil Apr 25, 2024
004208b
fix yaml (again)
Felixmil Apr 25, 2024
db0f2ae
make linux-build job starting only after windows-build job is completed
Felixmil Apr 25, 2024
61eb981
modified checkout step
Felixmil Apr 25, 2024
0253247
try nuget
rwmcintosh May 9, 2024
b9f2696
add packagesdirectory
rwmcintosh May 9, 2024
683e07f
update dotnet sdk
rwmcintosh May 9, 2024
8ee2075
update build and test
rwmcintosh May 9, 2024
7539c76
c++ cannot build using dotnet build
rwmcintosh May 9, 2024
76242ef
try setting path
rwmcintosh May 9, 2024
bd6f79c
try setting path
rwmcintosh May 9, 2024
c474ca8
use enterprise
rwmcintosh May 9, 2024
1af038a
use msbuild instead
rwmcintosh May 9, 2024
bbedacd
not diagnostic
rwmcintosh May 9, 2024
5e1a67f
setup R
rwmcintosh May 9, 2024
518a9fe
change r path
rwmcintosh May 9, 2024
7af6d59
change r path
rwmcintosh May 9, 2024
180a328
log test crash
rwmcintosh May 9, 2024
8ebe2b0
skip failing test
rwmcintosh May 9, 2024
b1a6cb1
skip build when testing
rwmcintosh May 9, 2024
95d8e7b
specify test projects
rwmcintosh May 9, 2024
62b6922
test release builds
rwmcintosh May 9, 2024
fa3ed65
try another assembly test
rwmcintosh May 9, 2024
11c9c1a
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 9, 2024
897bfe0
try linux build
rwmcintosh May 9, 2024
0ba8702
Merge branch 'C#-gha-workflow' of github.com:Open-Systems-Pharmacolog…
rwmcintosh May 9, 2024
938e0bd
try linux build
rwmcintosh May 9, 2024
617ad02
fix path separator
rwmcintosh May 9, 2024
8f16089
build release
rwmcintosh May 9, 2024
d2374f1
install R
rwmcintosh May 9, 2024
f449b3e
allow registry test skipping
rwmcintosh May 9, 2024
d53a477
set R_HOME
rwmcintosh May 9, 2024
9d3c464
skip tests on Linux
rwmcintosh May 9, 2024
7060ead
remove dependency on newtonsoft
rwmcintosh May 9, 2024
edd6692
build before test
rwmcintosh May 9, 2024
2c0b0e9
build before test
rwmcintosh May 9, 2024
75663d5
fix dependencies
rwmcintosh May 9, 2024
77286fd
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 9, 2024
08e0e87
trigger R actions only after binaries were built
Felixmil May 13, 2024
d712174
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 13, 2024
df8fd5d
always test with latest r version
Felixmil May 13, 2024
bd026cf
add quotes around building action name
Felixmil May 13, 2024
7e8f495
Merge branch 'C#-gha-workflow' of https://github.com/Open-Systems-Pha…
Felixmil May 13, 2024
4cb826d
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 13, 2024
c1847cb
force change in cpp to test .so commit
rwmcintosh May 13, 2024
fb27e12
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 13, 2024
051254a
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 13, 2024
b5526ff
undo force change in cpp to test .so commit
rwmcintosh May 13, 2024
9e8b8d0
Merge branch 'C#-gha-workflow' of github.com:Open-Systems-Pharmacolog…
rwmcintosh May 13, 2024
73bbd94
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 13, 2024
89ee59f
Commit from GitHub Actions (build-c#-binaries)
github-actions[bot] May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
branches: [main]
workflow_run:
workflows: ["build-c#-binaries"]
types:
- completed
workflow_dispatch:

name: R-CMD-check

Expand All @@ -22,7 +23,7 @@ jobs:
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
# - {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
107 changes: 107 additions & 0 deletions .github/workflows/build-c#.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
on:
pull_request:
branches: [main, master]
workflow_dispatch:

name: build-c#-binaries

jobs:
Linux-Build:

runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
# documentation: https://github.com/actions/setup-dotnet

- name: Make
working-directory: ./shared
run: make

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Test C# binaries
run: |
export R_HOME=/usr/lib/R
dotnet test ./shared/RDotNet.Tests/ -c Release -d log.txt --no-build
dotnet test ./shared/rSharpTests/ -c Release -d log.txt --no-build
dotnet test ./shared/DynamicInterop.Tests/ -c Release -d log.txt --no-build

- uses: EndBug/add-and-commit@v9
if: ${{ success() }}
with:
default_author: github_actions
add: '*.so'

Windows-Build:
needs: Linux-Build
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
# documentation: https://github.com/actions/setup-dotnet

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true


- name: Install dependencies
run: |
nuget restore ./shared/packages.config -PackagesDirectory ./shared/packages
dotnet restore ./shared/rSharp.sln

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build C# binaries
run: |
$env:R_INSTALL_PATH="C:\R"
msbuild ./shared/rSharp.sln -t:rebuild /p:Configuration=Release /p:Platform=x64

- name: Test C# binaries
run: |
dotnet test .\shared\RDotNet.Tests\ -c Release -d log.txt --no-build
dotnet test .\shared\rSharpTests\ -c Release -d log.txt --no-build
dotnet test .\shared\DynamicInterop.Tests\ -c Release -d log.txt --no-build


- uses: EndBug/add-and-commit@v9
if: ${{ success() }}
with:
default_author: github_actions
add: '*.dll'
12 changes: 5 additions & 7 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
release:
types: [published]
branches: [main]
workflow_run:
workflows: ["build-c#-binaries"]
types:
- completed
workflow_dispatch:

name: pkgdown
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
branches: [main]
workflow_run:
workflows: ["build-c#-binaries"]
types:
- completed
workflow_dispatch:

name: test-coverage

Expand Down
Binary file modified inst/extdata/rSharp.Examples.dll
Binary file not shown.
Binary file modified inst/lib/ClrFacade.dll
Binary file not shown.
Binary file modified inst/lib/DynamicInterop.dll
Binary file not shown.
Binary file modified inst/lib/RDotNet.dll
Binary file not shown.
24 changes: 12 additions & 12 deletions inst/lib/RSharp.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
}
}
}
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
}
}
}
Binary file modified inst/lib/rSharp.dll
Binary file not shown.
71 changes: 34 additions & 37 deletions shared/ClrFacade/ClrFacade.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{024B0C26-BED0-467D-B332-E9796B756133}</ProjectGuid>
<OutputType>Library</OutputType>
<Version>1.0.0</Version>
<Copyright></Copyright>
<Description>.NET interoperability on top of R.NET for the rSharp package</Description>
<Product>$(AssemblyName)</Product>
<Company />
<Authors>Open-Systems-Pharmacology</Authors>
<Title>rSharp; embed .NET in R</Title>
<PackageLicenseUrl>https://github.com/Open-Systems-Pharmacology/rsharp/blob/master/License.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/Open-Systems-Pharmacology/rsharp</RepositoryUrl>
<PackageProjectUrl>https://github.com/Open-Systems-Pharmacology/rsharp</PackageProjectUrl>
<PackageReleaseNotes></PackageReleaseNotes>
<!-- forces SDK to copy dependencies into build output to make packing easier -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\R.NET\RDotNet.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<ItemGroup>
<AssemblyFiles Include="$(TargetDir)*.dll" />
<ConfigFiles Include="$(SolutionDir)*.runtimeconfig.json" />
</ItemGroup>
<Copy SourceFiles="@(AssemblyFiles); @(ConfigFiles)" DestinationFolder="$(SolutionDir)..\inst\lib\" />
</Target>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{024B0C26-BED0-467D-B332-E9796B756133}</ProjectGuid>
<OutputType>Library</OutputType>
<Version>1.0.0</Version>
<Copyright></Copyright>
<Description>.NET interoperability on top of R.NET for the rSharp package</Description>
<Product>$(AssemblyName)</Product>
<Company />
<Authors>Open-Systems-Pharmacology</Authors>
<Title>rSharp; embed .NET in R</Title>
<PackageLicenseUrl>https://github.com/Open-Systems-Pharmacology/rsharp/blob/master/License.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/Open-Systems-Pharmacology/rsharp</RepositoryUrl>
<PackageProjectUrl>https://github.com/Open-Systems-Pharmacology/rsharp</PackageProjectUrl>
<PackageReleaseNotes></PackageReleaseNotes>
<!-- forces SDK to copy dependencies into build output to make packing easier -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\R.NET\RDotNet.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<ItemGroup>
<AssemblyFiles Include="$(TargetDir)*.dll" />
<ConfigFiles Include="$(SolutionDir)*.runtimeconfig.json" />
</ItemGroup>
<Copy SourceFiles="@(AssemblyFiles); @(ConfigFiles)" DestinationFolder="$(SolutionDir)..\inst\lib\" />
</Target>
</Project>
75 changes: 39 additions & 36 deletions shared/DynamicInterop.Tests/DynamicInterop.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<EnableUnmanagedDebugging Condition=" '$(Configuration)' == 'Debug' ">true</EnableUnmanagedDebugging>
<ProjectGuid>{CA934BF8-EC5B-49F5-8F52-25F3B11072E6}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Version>0.8.2</Version>
<Description>DynamicInterop unit tests</Description>
<Authors>Jean-Michel Perraud</Authors>
<PackageReleaseNotes>Migration to .NET Standard 2.0</PackageReleaseNotes>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Compile Remove="test_native_library\**" />
<EmbeddedResource Remove="test_native_library\**" />
<None Remove="test_native_library\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0"></PackageReference>
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<!-- Notice that xunit.assert, xunit.core, etc. are imported automatically.-->
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DynamicInterop\DynamicInterop.csproj">
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<EnableUnmanagedDebugging Condition=" '$(Configuration)' == 'Debug' ">true</EnableUnmanagedDebugging>
<ProjectGuid>{CA934BF8-EC5B-49F5-8F52-25F3B11072E6}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Version>0.8.2</Version>
<Description>DynamicInterop unit tests</Description>
<Authors>Jean-Michel Perraud</Authors>
<PackageReleaseNotes>Migration to .NET Standard 2.0</PackageReleaseNotes>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Compile Remove="test_native_library\**" />
<EmbeddedResource Remove="test_native_library\**" />
<None Remove="test_native_library\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0"></PackageReference>
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Notice that xunit.assert, xunit.core, etc. are imported automatically.-->
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DynamicInterop\DynamicInterop.csproj">
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>
Loading