Use pre-commit as a step in CI
This commit is contained in:
parent
71c1e1731e
commit
02b3674436
21
.ci.yml
21
.ci.yml
|
@ -5,12 +5,21 @@ platform:
|
||||||
os: linux
|
os: linux
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
steps:
|
trigger:
|
||||||
- name: Build
|
|
||||||
image: rg.fr-par.scw.cloud/serene/llvm:15-7
|
|
||||||
commands:
|
|
||||||
- cmake --version
|
|
||||||
- ./builder build
|
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build
|
||||||
|
image: rg.fr-par.scw.cloud/serene/llvm:15-8
|
||||||
|
commands:
|
||||||
|
- cmake --version
|
||||||
|
- ./builder build
|
||||||
|
- name: Lint
|
||||||
|
image: rg.fr-par.scw.cloud/serene/llvm:15-8
|
||||||
|
commands:
|
||||||
|
- pre-commit clang-tidy -a
|
||||||
|
- pre-commit cppcheck -a
|
||||||
|
- pre-commit include-what-you-use -a
|
||||||
|
- pre-commit shell-lint -a
|
||||||
|
|
|
@ -13,8 +13,6 @@ repos:
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-docstring-first
|
- id: check-docstring-first
|
||||||
- id: check-executables-have-shebangs
|
- id: check-executables-have-shebangs
|
||||||
- id: check-json
|
|
||||||
- id: check-yaml
|
|
||||||
- id: forbid-new-submodules
|
- id: forbid-new-submodules
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
@ -24,7 +22,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: clang-format
|
- id: clang-format
|
||||||
#- id: clang-tidy
|
#- id: clang-tidy
|
||||||
- id: oclint
|
#- id: oclint
|
||||||
- id: cppcheck
|
- id: cppcheck
|
||||||
args: ['--project=compile_commands.json']
|
args: ['--project=compile_commands.json']
|
||||||
#- id: cpplint
|
#- id: cpplint
|
||||||
|
|
|
@ -17,6 +17,8 @@ RUN apt-get update && apt-get install -y apt-utils && apt-get install -y wget \
|
||||||
software-properties-common \
|
software-properties-common \
|
||||||
zlib1g \
|
zlib1g \
|
||||||
apt-utils \
|
apt-utils \
|
||||||
|
cppcheck \
|
||||||
|
shellcheck \
|
||||||
zlib1g-dev
|
zlib1g-dev
|
||||||
|
|
||||||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
|
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
|
||||||
|
@ -27,11 +29,15 @@ RUN apt-get update --fix-missing && \
|
||||||
libmlir-${VERSION} \
|
libmlir-${VERSION} \
|
||||||
libmlir-${VERSION}-dbgsym \
|
libmlir-${VERSION}-dbgsym \
|
||||||
liblld-${VERSION} \
|
liblld-${VERSION} \
|
||||||
liblld-${VERSION}-dev
|
liblld-${VERSION}-dev \
|
||||||
|
clang-format-${VERSION} \
|
||||||
|
clang-tidy-${VERSION}
|
||||||
|
|
||||||
RUN ln -s `which lld-${VERSION}` /usr/bin/lld && \
|
RUN ln -s `which lld-${VERSION}` /usr/bin/lld && \
|
||||||
ln -s `which clang-${VERSION}` /usr/bin/clang && \
|
ln -s `which clang-${VERSION}` /usr/bin/clang && \
|
||||||
ln -s `which clang++-${VERSION}` /usr/bin/clang++ && \
|
ln -s `which clang++-${VERSION}` /usr/bin/clang++ && \
|
||||||
|
ln -s `which clang-format-${VERSION}` /usr/bin/clang-format && \
|
||||||
|
ln -s `which clang-tidy-${VERSION}` /usr/bin/clang-tidy && \
|
||||||
ln -s `which mlir-tblgen-${VERSION}` /usr/bin/mlir-tblgen
|
ln -s `which mlir-tblgen-${VERSION}` /usr/bin/mlir-tblgen
|
||||||
|
|
||||||
ENV MLIR_DIR /usr/lib/llvm-${VERSION}
|
ENV MLIR_DIR /usr/lib/llvm-${VERSION}
|
||||||
|
@ -46,5 +52,9 @@ RUN git clone https://github.com/include-what-you-use/include-what-you-use.git -
|
||||||
cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-${VERSION} ../include-what-you-use && \
|
cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-${VERSION} ../include-what-you-use && \
|
||||||
make && make install
|
make && make install
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /app
|
||||||
RUN rm /iwuy -rf
|
RUN rm /iwuy -rf
|
||||||
|
|
||||||
|
COPY .pre-commit-config.yaml .
|
||||||
|
RUN git init .
|
||||||
|
RUN apt-get install -y --no-install-recommends pre-commit && pre-commit autoupdate && rm /app/.pre-commit-config.yaml
|
||||||
|
|
Loading…
Reference in New Issue