-
-
Notifications
You must be signed in to change notification settings - Fork 101
151 lines (145 loc) · 4.64 KB
/
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: "CMake build"
on:
push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- linux-gcc
- macos-clang
- windows-msvc
- windows-mingw
configuration:
- Release
python-version:
- 3.11
include:
- toolchain: linux-gcc
os: ubuntu-latest
compiler: gcc
- toolchain: macos-clang
os: macos-latest
compiler: clang
- toolchain: windows-msvc
os: windows-latest
compiler: msvc
- toolchain: windows-mingw
os: windows-latest
compiler: mingw
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Setup python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install python packages
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
echo "/Users/runner/Library/Python/${{ matrix.python-version }}/bin" >> $GITHUB_PATH
fi
pip install --disable-pip-version-check --user "conan>=1.62.0,<2"
- name: Configure (${{ matrix.configuration }})
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
echo "/Users/runner/Library/Python/${{ matrix.python-version }}/bin" >> $GITHUB_PATH
fi
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake -S . -B build -DMATIO_USE_CONAN=ON -DMATIO_SHARED=OFF
elif [ "${{ matrix.compiler }}" == "mingw" ]; then
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DMATIO_USE_CONAN=ON -DMATIO_SHARED=OFF -DMATIO_ENABLE_CPPCHECK=ON -G "MinGW Makefiles"
else
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DMATIO_USE_CONAN=ON -DMATIO_SHARED=OFF -DMATIO_ENABLE_CPPCHECK=ON
fi
- name: Build with ${{ matrix.compiler }}
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake --build build --config ${{ matrix.configuration }}
else
cmake --build build -- -j8
fi
- name: Test
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
MATDUMP="./build/Release/matdump.exe"
else
MATDUMP="./build/bin/matdump"
fi
for file in ./share/*.mat; do
"$MATDUMP" -d "$file" d
"$MATDUMP" -v "$file"
"$MATDUMP" -v -f whos "$file"
done
"$MATDUMP" -v -H
"$MATDUMP" -V
build-openbsd:
runs-on: ubuntu-latest
name: openbsd-clang
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Test with clang
uses: vmactions/openbsd-vm@v1
with:
usesh: true
copyback: false
prepare: |
set -e
pkg_add cmake
run: |
set -e
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DMATIO_SHARED=OFF -DMATIO_MAT73=OFF
cmake --build build -- -j8
./build/test_snprintf
./build/test_mat -H
./build/test_mat -L
./build/test_mat -V
./build/matdump -v -H
./build/matdump -V
./build/matdump -d ./share/test_file.mat structure
./build/matdump -v ./share/test_file.mat
./build/matdump -v -f whos ./share/test_file.mat
build-solaris:
runs-on: ubuntu-latest
name: solaris-gcc
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Test with gcc
uses: vmactions/solaris-vm@v1
with:
release: 11.4
usesh: true
copyback: false
prepare: |
set -e
pkg install cmake gcc
run: |
set -e
mkdir build
cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=Release -DMATIO_SHARED=OFF -DMATIO_MAT73=OFF
cmake --build build -- -j8
./build/test_snprintf
./build/test_mat -H
./build/test_mat -L
./build/test_mat -V
./build/matdump -v -H
./build/matdump -V
./build/matdump -d ./share/test_file.mat structure
./build/matdump -v ./share/test_file.mat
./build/matdump -v -f whos ./share/test_file.mat