mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
add lint workflow
Related-To: NEO-6259 Closes: intel/compute-runtime#459 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
47eef95584
commit
fcb6b0b7b7
14
.github/actions/neo-lint/Dockerfile
vendored
Normal file
14
.github/actions/neo-lint/Dockerfile
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2021 Intel Corporation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM docker.io/ubuntu:20.04
|
||||||
|
|
||||||
|
RUN apt-get -y update ; apt-get install -y --no-install-recommends gpg software-properties-common
|
||||||
|
RUN apt-get -y update ; apt-get install -y --no-install-recommends clang-format-11 git
|
||||||
|
|
||||||
|
COPY lint.sh /lint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/lint.sh"]
|
||||||
17
.github/actions/neo-lint/action.yml
vendored
Normal file
17
.github/actions/neo-lint/action.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# action.yml
|
||||||
|
#
|
||||||
|
# Copyright (C) 2021 Intel Corporation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
|
||||||
|
name: 'Neo lint'
|
||||||
|
description: 'check coding style'
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
||||||
|
iregex:
|
||||||
|
description: 'iregex to pass to clang-format'
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
26
.github/actions/neo-lint/lint.sh
vendored
Executable file
26
.github/actions/neo-lint/lint.sh
vendored
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (C) 2021 Intel Corporation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
clang-format-11 --version
|
||||||
|
|
||||||
|
INPUT_PATH="${INPUT_PATH:-.}"
|
||||||
|
INPUT_IREGEX="${INPUT_IREGEX:-.*\.(cpp|h|inl)}"
|
||||||
|
|
||||||
|
(
|
||||||
|
cd ${INPUT_PATH}
|
||||||
|
git fetch origin ${GITHUB_BASE_REF}
|
||||||
|
set -x
|
||||||
|
git diff -U0 --no-color origin/master..HEAD | clang-format-diff-11 -p1 -i -v -iregex ${INPUT_IREGEX}
|
||||||
|
set +x
|
||||||
|
)
|
||||||
|
|
||||||
|
if [ -n "$(git -C ${INPUT_PATH} status --porcelain)" ]; then
|
||||||
|
git -C ${INPUT_PATH} diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
21
.github/workflows/verify.yml
vendored
Normal file
21
.github/workflows/verify.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2021 Intel Corporation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
|
||||||
|
name: verify
|
||||||
|
on:
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: neo
|
||||||
|
- name: lint
|
||||||
|
uses: ./neo/.github/actions/neo-lint
|
||||||
|
with:
|
||||||
|
path: neo
|
||||||
Reference in New Issue
Block a user