Repository navigation
77 lines (63 loc) · 2 KB
/
Copy pathmakefile.yml
File metadata and controls
77 lines (63 loc) · 2 KB
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
name: Build C# and Rust Project
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch:
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
build_mode: [debug, release]
env:
BUILD_MODE: ${{ matrix.build_mode }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust Dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
rust_test/target
key: rust-${{ runner.os }}-${{ hashFiles('rust_test/Cargo.lock') }}
- name: Cache .NET Dependencies
uses: actions/cache@v3
with:
path: |
~/.nuget/packages
CSharpDemo/obj
key: dotnet-${{ runner.os }}-${{ hashFiles('CSharpDemo/*.csproj') }}
- name: Build Rust Library (${{ matrix.build_mode }})
run: |
make rust BUILD_MODE=${{ matrix.build_mode }}
- name: Build C# Project (${{ matrix.build_mode }})
run: |
make csharp BUILD_MODE=${{ matrix.build_mode }}
- name: Copy Rust Library to C# Output
run: |
make copy_rust_lib BUILD_MODE=${{ matrix.build_mode }}
- name: Set Library Path (Linux/macOS)
if: runner.os != 'Windows'
run: |
echo "LD_LIBRARY_PATH=$(pwd)/CSharpDemo/bin/${{ matrix.build_mode }}/net9.0" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$(pwd)/CSharpDemo/bin/${{ matrix.build_mode }}/net9.0" >> $GITHUB_ENV
- name: Run C# Application (${{ matrix.build_mode }}) (Linux & macOS)
if: matrix.os != 'windows-latest'
run: |
make run BUILD_MODE=${{ matrix.build_mode }}