Skip to content

Fixes #22 C# gha workflow #30

Fixes #22 C# gha workflow

Fixes #22 C# gha workflow #30

Workflow file for this run

# 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]
pull_request:
branches: [main, master]
# release:
# types: [published]
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
r-version: '4.3.3'
- 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: '*.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
r-version: '4.3.3'
- 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'