64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
name: C++
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
fmt:
|
|
runs-on: alpine
|
|
container:
|
|
image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Format check
|
|
run: |
|
|
find . \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) \
|
|
-not -path './build/*' \
|
|
-exec clang-format --dry-run -Werror --style=file {} +
|
|
|
|
build & lint:
|
|
runs-on: alpine
|
|
container:
|
|
image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Cache CMake build
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: build
|
|
key: cpp-build-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt') }}
|
|
restore-keys: |
|
|
cpp-build-
|
|
|
|
- name: Cache ccache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.ccache
|
|
key: ccache-${{ runner.os }}-${{ github.sha }}
|
|
restore-keys: |
|
|
ccache-${{ runner.os }}-
|
|
|
|
- name: Configure
|
|
run: cmake -B build -G Ninja -DENABLE_MODULES=plugin -DCMAKE_BUILD_TYPE=Release
|
|
|
|
- name: Build
|
|
run: ninja -C build
|
|
env:
|
|
CMAKE_CXX_COMPILER_LAUNCHER: ccache
|
|
|
|
- name: clang-tidy
|
|
run: |
|
|
sed -i 's/-mno-direct-extern-access //g' build/compile_commands.json
|
|
set -o pipefail
|
|
run-clang-tidy -p build -j "$(nproc)" \
|
|
-source-filter="^$(pwd)/Plugins/" \
|
|
-header-filter=".*Plugins/.*" \
|
|
-removed-arg=-mno-direct-extern-access
|