This repository was archived by the owner on Jun 27, 2023. It is now read-only.
Repository navigation
84 lines (72 loc) · 2.41 KB
/
Copy pathci.yml
File metadata and controls
84 lines (72 loc) · 2.41 KB
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
name: CI/CD actions [Linux]
on:
push:
branches: [master, develop]
tags:
- 'v*'
paths-ignore:
- docs/**
- README.md
- CHANGELOG.md
pull_request:
branches: [master, develop]
paths-ignore:
- docs/**
- README.md
- CHANGELOG.md
env:
CONAN_VERSION: 1.56.0
jobs:
cpplint:
runs-on: ubuntu-22.04
name: Check C++ format and style
steps:
- name: Install dependencies
run: |
pipx install cpplint~=1.6
pipx install clang-format==15.0.4
- uses: actions/checkout@v2
- name: Run cpplint
run: find {tests,sources,matrix_compressor,examples,benchmarks}/ -name "*.cc" -o -name "*.h" | xargs cpplint
- name: Run clang-format
run: find {tests,sources,matrix_compressor,examples,benchmarks}/ -name "*.cc" -o -name "*.h" | xargs clang-format --dry-run --Werror
build_and_test:
needs: [cpplint]
runs-on: ${{ matrix.os }}
name: Build and test
strategy:
matrix:
build_type: [Debug, Release]
os: [ubuntu-22.04, windows-2019, macos-12]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: |
pipx install conan==${{ env.CONAN_VERSION }}
- name: Create profile
run: |
conan profile new default --detect
- name: Set libstdc++11
if: matrix.os == 'ubuntu-22.04'
run: conan profile update settings.compiler.libcxx=libstdc++11 default
- name: Build tests and examples
run: |
mkdir build
cd build
conan install .. -s build_type=${{ matrix.build_type }} --build=missing -pr:b=default
cmake .. -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DMC_BUILD_TESTS=ON -DMC_BUILD_EXAMPLES=ON -DMC_BUILD_BENCHMARKS=ON
cmake --build . -j --config ${{ matrix.build_type }}
- name: Run tests
run: |
cd build
ctest --output-on-failure -C ${{ matrix.build_type }}
- name: Install matrix_compressor
if: matrix.os == 'ubuntu-22.04'
run: |
cd build
sudo cmake --install .
- name: Check cmake target installation
if: matrix.os == 'ubuntu-22.04'
run: cmake --find-package -DNAME=matrix_compressor -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST