-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (82 loc) · 3.11 KB
/
run-tests.yml
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
name: Run tests
on:
pull_request:
branches:
- main
workflow_dispatch:
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
name: ${{ matrix.platform.name }} ${{ matrix.build-type }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
build-type: [Debug, Release]
platform:
- {
name: 'Windows GCC amd64',
os: windows-2022,
cmake-flags: '-GNinja'
}
- {
name: 'Windows CLang amd64',
os: windows-2022,
cmake-flags: '-GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'
}
- {
name: 'Windows VS v143 amd64',
os: windows-2022,
cmake-flags: '-G"Visual Studio 17" -T"v143"'
}
- {
name: 'Windows VS v142 amd64',
os: windows-2019,
cmake-flags: '-G"Visual Studio 16" -T"v142"'
}
# - {
# name: 'Windows VS v141 amd64',
# os: windows-2019,
# cmake-flags: '-G"Visual Studio 16" -T"v141"'
# }
- {
name: 'Linux CLang amd64',
os: ubuntu-22.04,
cmake-flags: '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'
}
- {
name: 'Linux GCC amd64',
os: ubuntu-latest
}
- {
name: 'Mac OS amd64',
os: macos-13
}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Configure Project
run: ${{ runner.os!='Windows'&&'sudo '||''}}cmake . ${{ matrix.platform.cmake-flags }} -Bcmake-build-release -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Build Project
run: ${{ runner.os!='Windows'&&'sudo '||''}}cmake --build cmake-build-release --config=${{ matrix.build-type }}
- name: Create local runtime NuGet package
run: ${{ runner.os!='Windows'&&'sudo '||''}}cmake --build cmake-build-release --config=${{ matrix.build-type }} --target cpu_features_dotnet_runtime_package
- name: Create local NuGet package
run: ${{ runner.os!='Windows'&&'sudo '||''}}cmake --build cmake-build-release --config=${{ matrix.build-type }} --target cpu_features_dotnet_package
- name: Add NuGet package to tests
run: ${{ runner.os!='Windows'&&'sudo '||''}}cmake --build cmake-build-release --config=${{ matrix.build-type }} --target add_nuget_package_to_tests
- name: Create build
run: ${{ runner.os!='Windows'&&'sudo '||''}}dotnet build "src/CpuFeaturesDotNet" -c ${{ matrix.build-type }} --force
- name: Run Unit Tests for .NET 6
run: ${{ runner.os!='Windows'&&'sudo '||''}}dotnet test "tests" -c ${{ matrix.build-type }} -f net6.0