build: Disable C++20 module scanning for clang #23
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: C++ CI | |
on: | |
push: | |
branches: | |
- master | |
- releases/v* | |
pull_request: | |
merge_group: | |
jobs: | |
build-and-test: | |
name: Test ${{ matrix.os }}-${{ matrix.compiler }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, windows-2022] | |
compiler: [gcc, clang, msvc] | |
exclude: | |
- os: ubuntu-22.04 | |
compiler: msvc | |
- os: windows-2022 | |
compiler: gcc | |
include: | |
- os: ubuntu-22.04 | |
triplet: x64-linux | |
install: | | |
sudo apt-get -qq update | |
sudo apt-get -qq install nasm | |
- os: ubuntu-22.04 | |
triplet: x64-linux | |
compiler: clang | |
install: | | |
sudo cp tools/llvm-snapshot.gpg.key.asc /etc/apt/trusted.gpg.d/llvm-snapshot.asc | |
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | |
sudo apt-get -qq update | |
sudo apt-get -qq -y install clang-16 nasm | |
- os: windows-2022 | |
triplet: x64-windows | |
env: | |
CTEST_OUTPUT_ON_FAILURE: "1" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install go (boringSSL build dependency) | |
if: ${{ !startsWith(matrix.os, 'windows-') }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.20.7' | |
- name: Install required packages / compilers | |
if: ${{ matrix.install }} | |
run: ${{ matrix.install }} | |
- uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: 3.22.6 | |
- name: Initialize vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg | |
vcpkgGitCommitId: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 | |
- name: Build ${{ matrix.triplet }}-${{ matrix.compiler }} preset | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: ${{ matrix.triplet }}-${{ matrix.compiler }} | |
buildPreset: ${{ matrix.triplet }}-${{ matrix.compiler }} | |
testPreset: ${{ matrix.triplet }}-${{ matrix.compiler }} | |
env: | |
CC: '' | |
CXX: '' | |
- name: Build ${{ matrix.triplet }}-${{ matrix.compiler }}-release preset | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: ${{ matrix.triplet }}-${{ matrix.compiler }} | |
buildPreset: ${{ matrix.triplet }}-${{ matrix.compiler }}-release | |
testPreset: ${{ matrix.triplet }}-${{ matrix.compiler }}-release | |
env: | |
CC: '' | |
CXX: '' | |
- name: Prevent uploading a corrupted vcpkg cache | |
if: ${{ failure() || cancelled() }} | |
run: | | |
echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV | |
shell: bash | |
check-format: | |
name: clang-tidy & clang-format | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install go (boringSSL build dependency) | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.20.7' | |
- name: "Install clang-tools-16" | |
run: | | |
sudo cp ${{ github.workspace }}/tools/llvm-snapshot.gpg.key.asc /etc/apt/trusted.gpg.d/llvm-snapshot.asc | |
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | |
sudo apt-get -qq update | |
sudo apt-get -qq -y install clang-16 clang-tidy-16 clang-format-16 nasm | |
- name: Install go (boringSSL build dependency) | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.20.7' | |
- name: Install nasm (boringSSL build dependency) | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get -qq install nasm | |
- uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: 3.22.6 | |
- name: Initialize vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: ${{ github.workspace }}/../vcpkg | |
vcpkgGitCommitId: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 | |
- name: Configure x64-linux-clang preset | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: x64-linux-ci-lint | |
- uses: cpp-linter/cpp-linter-action@v2 | |
name: Lint with clang-format and clang-tidy | |
id: linter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
version: 16.0.6 | |
style: file # use .clang-format settings | |
tidy-checks: '' # use .clang-tidy settings | |
extensions: cpp,hpp | |
ignore: '.github|build|external' | |
files-changed-only: true | |
database: build/x64-linux-ci-lint | |
- name: Fail if issues have been raised | |
if: steps.linter.outputs.checks-failed > 0 | |
run: exit 1 | |
- if: ${{ failure() || cancelled() }} | |
run: | | |
echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV | |
shell: bash |