-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (54 loc) · 1.79 KB
/
ci.yml
File metadata and controls
67 lines (54 loc) · 1.79 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
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
build-test:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
include-prerelease: true
- name: Show .NET info
run: dotnet --info
- name: Restore dependencies
run: dotnet restore MLXSharp.sln
- name: Build
run: dotnet build MLXSharp.sln --configuration Release --no-restore
- name: Prepare artifact folders
run: |
mkdir -p artifacts/test-results
mkdir -p artifacts/packages
mkdir -p artifacts/native
- name: Build native wrapper
run: |
cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release
cmake --build native/build --target mlxsharp
cp native/build/libmlxsharp.dylib artifacts/native/
- name: Run tests
run: dotnet test MLXSharp.sln --configuration Release --no-build --logger "trx;LogFileName=TestResults.trx" --results-directory artifacts/test-results
- name: Pack library
run: dotnet pack src/MLXSharp/MLXSharp.csproj --configuration Release --no-build --output artifacts/packages
- name: Upload native artifact
uses: actions/upload-artifact@v4
with:
name: native-libs
path: artifacts/native
- name: Upload packages artifact
uses: actions/upload-artifact@v4
with:
name: packages
path: artifacts/packages
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: artifacts/test-results