-
Notifications
You must be signed in to change notification settings - Fork 14
98 lines (91 loc) · 2.87 KB
/
Copy pathcsharp-ci.yml
File metadata and controls
98 lines (91 loc) · 2.87 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: C# CI
on:
push:
branches: [main]
paths:
- "bindings/csharp/**"
- "core"
- "examples/csharp_*/**"
- ".github/workflows/csharp-ci.yml"
pull_request:
branches: [main]
paths:
- "bindings/csharp/**"
- "core"
- "examples/csharp_*/**"
- ".github/workflows/csharp-ci.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOTNET_NOLOGO: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
defaults:
run:
working-directory: bindings/csharp
jobs:
lint:
name: Format & Analyze
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Checkout core
working-directory: .
run: git submodule update --init core
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- run: dotnet restore NativeAPI.slnx
- name: Check formatting and code style
run: dotnet format NativeAPI.slnx --verify-no-changes --no-restore
- name: Build with analyzers
run: dotnet build NativeAPI.slnx -c Release --no-restore -warnaserror
build-test:
name: Build & Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
library: build/native/libnativeapi.so
- os: macos-latest
library: build/native/libnativeapi.dylib
- os: windows-latest
library: build/native/Release/nativeapi.dll
steps:
- uses: actions/checkout@v4
- name: Checkout core
working-directory: .
run: git submodule update --init core
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake pkg-config libgtk-3-dev libx11-dev libxi-dev
- name: Configure native library
run: cmake -S src/CNativeAPI/native -B build/native -DCMAKE_BUILD_TYPE=Release
- name: Build native library
run: cmake --build build/native --config Release --parallel 2
- name: Build managed libraries, examples and tests
run: dotnet build NativeAPI.slnx -c Release -warnaserror
- name: Run native integration tests
env:
NATIVEAPI_LIBRARY_PATH: ${{ github.workspace }}/bindings/csharp/${{ matrix.library }}
run: dotnet test NativeAPI.slnx -c Release --no-build --logger trx --results-directory TestResults
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}
path: bindings/csharp/TestResults/*.trx
if-no-files-found: ignore