Skip to content

Fixes #22 C# gha workflow #39

Fixes #22 C# gha workflow

Fixes #22 C# gha workflow #39

Workflow file for this run

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'