-
Notifications
You must be signed in to change notification settings - Fork 74
99 lines (83 loc) · 3.01 KB
/
CPPTest.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
95
96
97
98
99
name: 'C++ Test'
on:
push:
branches:
- master
pull_request:
branches:
- '*'
env:
tests_path: Sources/Tests/CPPWrapperUnitTests/tests
jobs:
Testing:
strategy:
matrix:
include:
- os: windows-latest
flag: win-x64
- os: ubuntu-latest
flag: linux-x64
- os: macos-latest
flag: osx-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.100'
include-prerelease: true
- name: 'Install some libs for Linux'
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install zlib1g-dev
sudo apt-get install libkrb5-dev
- name: 'Building the library into native for Windows'
if: ${{ matrix.os == 'windows-latest' }}
shell: cmd
run: |
cd Sources/Wrappers/AngouriMath.CPP.Exporting
mkdir ../AngouriMath.CPP.Importing/out-x64
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
dotnet publish -p:NativeLib=Shared -p:SelfContained=true -r ${{ matrix.flag }} -c release
- name: 'Building the library into native for Linux & MacOS'
if: ${{ matrix.os != 'windows-latest' }}
run: |
cd Sources/Wrappers/AngouriMath.CPP.Exporting
mkdir ../AngouriMath.CPP.Importing/out-x64
dotnet publish -p:NativeLib=Shared -p:SelfContained=true -r ${{ matrix.flag }} -c release
- name: 'Preparing tests'
run: |
cd ${{ env.tests_path }}
cmake -S . -B build
mkdir "build/Debug"
- name: 'Copying the library for Windows'
if: ${{ matrix.os == 'windows-latest' }}
run: |
cd ${{ env.tests_path }}
copy "..\..\..\Wrappers\AngouriMath.CPP.Importing\out-x64\AngouriMath.CPP.Exporting.dll" "build\Debug\AngouriMath.CPP.Exporting.dll"
- name: 'Copying the library for Linux'
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cd ${{ env.tests_path }}
cp -a "../../../Wrappers/AngouriMath.CPP.Importing/out-x64/AngouriMath.CPP.Exporting.so" "build/Debug/libAngouriMath.CPP.Exporting.so"
- name: 'Copying the library for OS X'
if: ${{ matrix.os == 'macos-latest' }}
run: |
cd ${{ env.tests_path }}
cp -r "../../../Wrappers/AngouriMath.CPP.Importing/out-x64/AngouriMath.CPP.Exporting.dylib" "build/Debug/libAngouriMath.CPP.Exporting.dylib"
cd build/Debug
path=$(pwd)
install_name_tool -id "$path/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib
- name: 'Building and running tests'
run: |
cd ${{ env.tests_path }}
cmake --build build
cd build
ctest
- name: 'Upload logs'
if: failure()
uses: actions/upload-artifact@v2
with:
name: Logs
path: ./Sources/Tests/CPPWrapperUnitTests/tests/build/Testing/Temporary