mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 20:05:51 +00:00
36
.github/actions/clang_format/action.yml
vendored
36
.github/actions/clang_format/action.yml
vendored
@@ -1,36 +0,0 @@
|
|||||||
name: Check format
|
|
||||||
description: Check format using clang-format-17
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Add llvm repo
|
|
||||||
run: |
|
|
||||||
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main' | sudo tee -a /etc/apt/sources.list
|
|
||||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install packages
|
|
||||||
run: |
|
|
||||||
sudo apt update -qq
|
|
||||||
sudo apt install -y jq clang-format-17
|
|
||||||
sudo rm /usr/bin/clang-format
|
|
||||||
sudo ln -s /usr/bin/clang-format-17 /usr/bin/clang-format
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run formatter
|
|
||||||
continue-on-error: true
|
|
||||||
id: run_formatter
|
|
||||||
run: |
|
|
||||||
./.githooks/pre-commit
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Check for differences
|
|
||||||
id: assert
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
git diff --color --exit-code | tee "clang-format.patch"
|
|
||||||
|
|
||||||
- name: Fail job
|
|
||||||
if: ${{ steps.run_formatter.outcome != 'success' }}
|
|
||||||
shell: bash
|
|
||||||
run: exit 1
|
|
||||||
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -7,17 +7,22 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
check_format:
|
||||||
name: Check format
|
name: Check format
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
container:
|
||||||
|
image: rippleci/clio_ci:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Run clang-format
|
- name: Run formatters
|
||||||
uses: ./.github/actions/clang_format
|
id: run_formatters
|
||||||
|
run: |
|
||||||
|
./.githooks/pre-commit
|
||||||
|
shell: bash
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
needs: lint
|
needs: check_format
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -31,9 +31,10 @@ RUN apt update -qq \
|
|||||||
&& update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-${GCC_VERSION} 100 \
|
&& update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-${GCC_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-${GCC_VERSION} 100 \
|
&& update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-${GCC_VERSION} 100 \
|
||||||
&& update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-${GCC_VERSION} 100 \
|
&& update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-${GCC_VERSION} 100 \
|
||||||
|
&& update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${LLVM_TOOLS_VERSION} 100 \
|
||||||
&& apt-get clean && apt remove -y software-properties-common \
|
&& apt-get clean && apt remove -y software-properties-common \
|
||||||
&& pip3 install -q --upgrade --no-cache-dir pip \
|
&& pip3 install -q --upgrade --no-cache-dir pip \
|
||||||
&& pip3 install -q --no-cache-dir conan==1.62 gcovr
|
&& pip3 install -q --no-cache-dir conan==1.62 gcovr cmake-format
|
||||||
|
|
||||||
# Install ccache from source
|
# Install ccache from source
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
|
|||||||
Reference in New Issue
Block a user