-
Notifications
You must be signed in to change notification settings - Fork 6
92 lines (89 loc) · 3.34 KB
/
build-and-test.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
name: Build and test
on: [push, workflow_dispatch]
jobs:
linux:
name: Linux
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan-packages
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-${{ hashFiles('**/conan.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.build_type }}-
${{ runner.os }}-
- name: Configure Conan
run: |
conan profile detect -f
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Install dependencies
run: conan install --build=missing --output-folder=build -s build_type=${{ matrix.build_type }} --lockfile-out ~/.conan2/conan.lock .
- name: Generate build system
run: cmake --preset conan-$(echo ${{ matrix.build_type }} | tr '[:upper:]' '[:lower:]') -DPROXYFMU_BUILD_EXAMPLES=ON -DPROXYFMU_BUILD_TESTS=ON
- name: Build
run: cmake --build --preset conan-$(echo ${{ matrix.build_type }} | tr '[:upper:]' '[:lower:]')
- name: Test
run: |
cd build/tests
ctest --output-on-failure --extra-verbose
- uses: actions/upload-artifact@v3
if: matrix.build_type == 'Release'
with:
name: proxyfmu
path: build/bin/proxyfmu*
windows:
name: Windows
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan-packages
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-${{ hashFiles('**/conan.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.build_type }}-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.build_type }}-
${{ runner.os }}-
- name: Configure Conan
run: |
conan profile detect -f
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Install dependencies
run: conan install --build=missing --output-folder=build -s build_type=${{ matrix.build_type }} --lockfile-out ~/.conan2/conan.lock .
- name: Generate build system
run: cmake --preset conan-default -DPROXYFMU_BUILD_EXAMPLES=ON -DPROXYFMU_BUILD_TESTS=ON
- name: Build
run: cmake --build --preset "conan-${{ matrix.build_type }}".ToLower()
- name: Test
run: |
cd build/tests
ctest -C ${{ matrix.build_type }} --output-on-failure --extra-verbose
- uses: actions/upload-artifact@v3
if: matrix.build_type == 'Release'
with:
name: proxyfmu
path: build/bin/proxyfmu*