Skip to content

Commit e02479f

Browse files
author
feihong
committed
add cmake ci
1 parent 56bd7e4 commit e02479f

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/cmake.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CMake CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest]
14+
qt_version: [5, 6]
15+
python_version: ["3.8", "3.9", "3.10"]
16+
fail-fast: false
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python_version }}
26+
27+
- name: Install dependencies (Linux)
28+
if: runner.os == 'Linux'
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install -y qt${{ matrix.qt_version }}-base qt${{ matrix.qt_version }}-tools
32+
33+
- name: Install dependencies (Windows)
34+
if: runner.os == 'Windows'
35+
run: |
36+
choco install qt${{ matrix.qt_version }} --version ${{ matrix.qt_version }}.0.0 --params "/InstallationFolder C:/Qt/${{ matrix.qt_version }}"
37+
echo "C:/Qt/${{ matrix.qt_version }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
38+
39+
- name: Configure CMake
40+
run: |
41+
mkdir build
42+
cmake -S . -B build \
43+
-DCMAKE_BUILD_TYPE=Release \
44+
-DCMAKE_INSTALL_PREFIX=./install
45+
46+
- name: Build project
47+
run: |
48+
cmake --build build --parallel --target all install
49+
50+
- name: Run tests
51+
run: |
52+
cd build
53+
ctest --output-on-failure

0 commit comments

Comments
 (0)