forked from quickfix/quickfix
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (132 loc) · 4.58 KB
/
build_test_cmake.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build with CMake
on: [pull_request, push]
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [windows-2019, windows-2022, ubuntu-latest, macos-latest]
configuration: [Debug, Release]
include:
- configuration: Debug
config: debug
portoffset: 0
- configuration: Release
config: release
portoffset: 1
steps:
- name: Echo event_name ${{ github.event_name }}
shell: bash
run: echo "github.event_name $event_name"
env:
event_name: ${{ github.event_name }}
- name: Checkout
uses: actions/checkout@v2
- name: Generate
shell: bash
run: |
cmake . -DCMAKE_BUILD_TYPE=$Configuration -DCMAKE_INSTALL_PREFIX=../install_prefix/$Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Build
shell: bash
run: |
cmake --build . --config $Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Set tests paths windows
shell: bash
if: ${{ matrix.runner == 'windows-2019' || matrix.runner == 'windows-2022' }}
run: |
echo "at=$PWD/test/$Config/at/at.exe" >> GITHUB_ENV
echo "pt=$PWD/test/$Config/pt/pt.exe" >> GITHUB_ENV
echo "ut=$PWD/test/$Config/ut/ut.exe" >> GITHUB_ENV
env:
Config: ${{ matrix.config }}
- name: Set tests paths ubuntu-latest
shell: bash
if: ${{ matrix.runner == 'ubuntu-latest' }}
run: |
echo "at=$PWD/test/at" >> GITHUB_ENV
echo "pt=$PWD/test/pt" >> GITHUB_ENV
echo "ut=$PWD/test/ut" >> GITHUB_ENV
- name: Set tests paths macos-latest
shell: bash
if: ${{ matrix.runner == 'macos-latest' }}
run: |
echo "at=$PWD/test/at" >> GITHUB_ENV
echo "pt=$PWD/test/pt" >> GITHUB_ENV
echo "ut=$PWD/test/ut" >> GITHUB_ENV
- name: Echo test paths ${{ matrix.runner }}
shell: bash
run: |
echo "at: $at"
echo "pt: $pt"
echo "ut: $ut"
env:
at: ${{ env.at }}
pt: ${{ env.pt }}
ut: ${{ env.ut }}
- name: Check if tests were built
id: check_files
shell: bash
run: |
AT=$( test -f $at && echo "true" || echo "false" )
PT=$( test -f $pt && echo "true" || echo "false" )
UT=$( test -f $ut && echo "true" || echo "false" )
echo "at_check=$AT" >> GITHUB_ENV
echo "pt_check=$PT" >> GITHUB_ENV
echo "ut_check=$UT" >> GITHUB_ENV
env:
at: ${{ env.at }}
pt: ${{ env.pt }}
ut: ${{ env.ut }}
- name: Echo test checks ${{ matrix.runner }}
shell: bash
run: |
echo "at_check: $at_check"
echo "pt_check: $pt_check"
echo "ut_check: $ut_check"
env:
at_check: ${{ env.at_check }}
pt_check: ${{ env.pt_check }}
ut_check: ${{ env.ut_check }}
- name: Run acceptance tests for windows
if: ${{ env.at_check == 'true' && (matrix.runner == 'windows-2019' || matrix.runner == 'windows-2022') && github.event_name == 'pull_request' }}
shell: cmd
working-directory: ./test
run: |
set /a "PORT=%PortBase%+%Offset%"
runat %CONFIG% %PORT%
env:
CONFIG: ${{ matrix.config }}
PortBase: 6666
Offset: ${{ matrix.portoffset }}
- name: Run acceptance tests for ${{ matrix.runner }}
if: ${{ env.at_check == 'true' && (matrix.runner != 'windows-2019' && matrix.runner != 'windows-2022') && github.event_name == 'pull_request' }}
shell: bash
working-directory: ./test
run: |
./runat.sh $(($PortBase + $Offset))
env:
PortBase: 6666
Offset: ${{ matrix.portoffset }}
- name: Run performance tests
if: ${{ env.pt_check == 'true' && matrix.configuration == 'Release' }}
shell: bash
working-directory: ./test
run: |
$pt -p $(($PortBase + $Offset)) -c 500000
env:
pt: ${{ env.pt }}
PortBase: 6668
Offset: ${{ matrix.portoffset }}
- name: Run unit tests
if: ${{ env.ut_check == 'true' }}
shell: bash
working-directory: ./test
run: |
$ut --quickfix-config-file cfg/ut.cfg --quickfix-spec-path ../spec
env:
ut: ${{ env.ut }}