-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (106 loc) · 3.41 KB
/
ci.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
name: SQUINT CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test-linux:
name: Build and Test (Linux)
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
version: [12, 17]
blas: [MKL, OpenBLAS, NONE]
include:
- compiler: gcc
version: 12
dockerfile: Dockerfile.gcc-dev
- compiler: clang
version: 17
dockerfile: Dockerfile.llvm-dev
exclude:
- compiler: gcc
version: 17
- compiler: clang
version: 12
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t ${{ matrix.compiler }}-${{ matrix.version }} \
--build-arg COMPILER_VERSION=${{ matrix.version }} \
-f ${{ github.workspace }}/${{ matrix.dockerfile }} .
- name: Build and Test in Docker
run: |
docker run --rm -v ${{ github.workspace }}:/src ${{ matrix.compiler }}-${{ matrix.version }} bash -c "
cd /src &&
mkdir build &&
cd build &&
source /opt/intel/oneapi/setvars.sh &&
cmake .. -G Ninja \
-DSQUINT_BUILD_TESTS=ON \
-DBLAS_BACKEND=${{ matrix.blas }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }}-${{ matrix.version }} &&
cmake --build . &&
ctest -L SQUINT --output-on-failure
"
build-and-test-windows:
name: Build and Test (Windows)
runs-on: windows-2022
strategy:
matrix:
compiler: [msvc]
version: [2022]
blas: [MKL, OpenBLAS, NONE]
include:
- compiler: msvc
version: 2022
dockerfile: Dockerfile.msvc-dev
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t ${{ matrix.compiler }}-${{ matrix.version }} `
--build-arg COMPILER_VERSION=${{ matrix.version }} `
-f ${{ github.workspace }}/${{ matrix.dockerfile }} .
- name: Build and Test in Docker
run: |
docker run --rm -v ${{ github.workspace }}:/src ${{ matrix.compiler }}-${{ matrix.version }} powershell -Command "
cd /src;
mkdir build;
cd build;
cmake .. -G Ninja `
-DSQUINT_BUILD_TESTS=ON `
-DBLAS_BACKEND=${{ matrix.blas }};
cmake --build .;
ctest -L SQUINT --output-on-failure
"
shell: pwsh
clang-tidy:
name: Clang-Tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t llvm-dev --build-arg COMPILER_VERSION=17 -f ${{ github.workspace }}/Dockerfile.llvm-dev .
- name: Run Clang-Tidy in Docker
run: |
docker run --rm -v ${{ github.workspace }}:/src llvm-dev bash -c "
cd /src &&
mkdir build &&
cd build &&
cmake .. -G Ninja -DSQUINT_BUILD_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBLAS_BACKEND=NONE &&
cmake --build . &&
find ../include -name '*.cpp' -or -name '*.hpp' |
xargs -P $(nproc) clang-tidy -p .
--config-file=../.clang-tidy
"
- name: Check Clang-Tidy result
run: |
if [ $? -ne 0 ]; then
echo "Clang-Tidy found issues. Please fix them before merging."
exit 1
fi