Skip to content

yeet clang from win

yeet clang from win #9

Workflow file for this run

name: CI
on:
pull_request:
branches:
- master
types: [opened, synchronize, labeled]
push:
branches:
- master
jobs:
clang-format:
name: Check clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format
- name: Check formatting
run: |
git fetch --depth=1 origin master
clang-format -style=file -output-replacements-xml $(git ls-files '*.cpp' '*.h' '*.ixx' '*.hpp') | grep "<replacement " && echo "Code is not properly formatted" && exit 1 || echo "All good"
build:
name: Build project
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-ci'))
strategy:
matrix:
include:
- os: windows-latest
compiler: msvc
- os: ubuntu-latest
compiler: clang
steps:
- uses: actions/checkout@v3
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.29.0'
- name: Install compiler on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
if [ "${{ matrix.compiler }}" == "clang" ]; then
sudo apt-get install -y clang
fi
shell: bash
- name: Setup MSVC environment
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Configure CMake
run: |
mkdir build
cd build
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
if [ "${{ matrix.compiler }}" == "clang" ]; then
cmake -G Ninja -DCMAKE_CXX_COMPILER=clang++ ..
fi
elif [ "${{ matrix.os }}" == "windows-latest" ]; then
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake -G "Visual Studio 17 2022" -A x64 ..
fi
fi
shell: bash
- name: Build
run: |
if [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake --build build --config Release
else
cmake --build build --config Release
fi
shell: bash