-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (95 loc) · 3.31 KB
/
build-c#.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# 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: |
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
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'