save #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |