remove gcc #5
This file contains hidden or 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: 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: windows-latest | |
compiler: clang | |
- 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 | |
elif [ "${{ matrix.compiler }}" == "gcc" ]; then | |
sudo apt-get install -y g++ | |
fi | |
shell: bash | |
- name: Configure CMake | |
run: | | |
mkdir build | |
cd build | |
GENERATOR="-G Ninja" | |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then | |
if [ "${{ matrix.compiler }}" == "clang" ]; then | |
cmake $GENERATOR -DCMAKE_CXX_COMPILER=clang++ .. | |
elif [ "${{ matrix.compiler }}" == "gcc" ]; then | |
cmake $GENERATOR -DCMAKE_CXX_COMPILER=g++ .. | |
fi | |
else | |
cmake $GENERATOR .. | |
fi | |
shell: bash | |
- name: Build | |
run: cmake --build build --config Release | |
shell: bash |