-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fb5b07
commit 51dc285
Showing
6 changed files
with
211 additions
and
117 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,6 @@ on: | |
types: [assigned, opened, synchronize, reopened] | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
# This is already the default, except when running inside another Docker | ||
# image, which is the case here. So set it up globally to avoid | ||
# repeating elsewhere. | ||
shell: bash | ||
|
||
env: | ||
# Run apt package manager in the CI in non-interactive mode. | ||
# Otherwise, on Ubuntu 20.04 the installation of tzdata asking question | ||
|
@@ -53,11 +46,8 @@ jobs: | |
run: | | ||
pip install cmake numpy psutil pybind11 rich pkginfo lit PyYAML | ||
- name: Install Ninja | ||
run: sudo apt-get install -y ninja-build | ||
|
||
- name: Install lld and clang (for aiecc) | ||
run: sudo apt-get install -y clang lld | ||
- name: Install packages | ||
run: sudo apt-get install -y ninja-build clang lld | ||
|
||
- name: Get MLIR | ||
id: mlir-wheels | ||
|
@@ -68,7 +58,6 @@ jobs: | |
echo "MLIR_DIR=$PWD/mlir" | tee -a $GITHUB_OUTPUT | ||
- name: Ccache for C++ compilation | ||
# https://github.com/hendrikmuhs/ccache-action/releases/tag/v1.2.9 | ||
uses: hendrikmuhs/ccache-action@ca3acd2731eef11f1572ccb126356c2f9298d35e | ||
with: | ||
# Since there are now several compilation jobs running in parallel, | ||
|
@@ -139,7 +128,9 @@ jobs: | |
ninja check-tutorials | ||
ninja check-reference-designs | ||
clang-tidy: | ||
clang-tidy-pylint: | ||
|
||
name: Python and C/C++ Lint | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
|
@@ -205,7 +196,6 @@ jobs: | |
run: | | ||
git fetch origin main | ||
git diff -U0 origin/main | clang-tidy-diff -p1 -path build -export-fixes fixes.yml | ||
cat fixes.yml | ||
- name: Post clang-tidy requests | ||
env: | ||
|
@@ -222,9 +212,141 @@ jobs: | |
--request-changes "false" \ | ||
--suggestions-per-comment 10 | ||
# You can feed the pylintrc path to ciborow/action-pylint | ||
# but it doesn't seem to work. | ||
- name: Copy pylintrcs | ||
run: | | ||
cp .pylintrc python/.pylintrc | ||
cp .pylintrc test/python/.pylintrc | ||
cp .pylintrc tutorials/.pylintrc | ||
cp .pylintrc reference_designs/.pylintrc | ||
cp .pylintrc utils/.pylintrc | ||
# You can just do this wholesale at the root (not use workdir) | ||
# but it'll take too long because it picks up | ||
# the stuff in the build directory. | ||
- uses: dciborow/[email protected] | ||
env: | ||
PYTHONPATH: build/python | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-review | ||
# GitHub Status Check won't become failure with warning. | ||
level: warning | ||
filter_mode: diff_context | ||
workdir: python | ||
glob_pattern: "**/*.py" | ||
|
||
- uses: dciborow/[email protected] | ||
env: | ||
PYTHONPATH: build/python | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-review | ||
level: warning | ||
filter_mode: diff_context | ||
workdir: test/python | ||
glob_pattern: "**/*.py" | ||
|
||
- uses: dciborow/[email protected] | ||
env: | ||
PYTHONPATH: build/python | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-review | ||
level: warning | ||
filter_mode: diff_context | ||
workdir: tutorials | ||
glob_pattern: "**/*.py" | ||
|
||
- uses: dciborow/[email protected] | ||
env: | ||
PYTHONPATH: build/python | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-review | ||
level: warning | ||
filter_mode: diff_context | ||
workdir: reference_designs | ||
glob_pattern: "**/*.py" | ||
|
||
- uses: dciborow/[email protected] | ||
env: | ||
PYTHONPATH: build/python | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-review | ||
level: warning | ||
filter_mode: diff_context | ||
workdir: utils | ||
glob_pattern: "**/*.py" | ||
|
||
formatting: | ||
|
||
name: Python and C/C++ Formatting | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Get the project repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
submodules: "true" | ||
|
||
- name: Install clang-format | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
clangformat: 17.0.1 | ||
|
||
- name: Setup Python env | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install black | ||
run: pip install black[jupyter] | ||
|
||
- name: Run git-clang-format | ||
id: git-clang-format | ||
run: | | ||
git fetch origin main | ||
# git clang-format returns an error if changes made? | ||
git clang-format origin/main || true | ||
- name: Check C/C++ format | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: clang-format | ||
level: error | ||
fail_on_error: true | ||
cleanup: true | ||
|
||
- name: Run black format | ||
if: success() || failure() | ||
id: black-format | ||
run: | | ||
# FORMATTED=0 | ||
black --exclude python/compiler/aiecc/main.py . || true | ||
black -l 10000 python/compiler/aiecc/main.py || true | ||
# FORMATTED=$(git status -s -uno | wc -l | xargs) | ||
# echo "FORMATTED=$FORMATTED" | tee -a $GITHUB_OUTPUT | ||
- name: Check Python format | ||
if: success() || failure() | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: black | ||
level: error | ||
fail_on_error: true | ||
|
||
code-coverage: | ||
|
||
name: Code Coverage | ||
name: C/C++ test code coverage | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -248,10 +370,7 @@ jobs: | |
pip install cmake numpy psutil pybind11 rich lit | ||
- name: Install Ninja | ||
run: sudo apt-get install -y ninja-build | ||
|
||
- name: Install llvm-cov | ||
run: sudo apt-get install -y clang lld llvm | ||
run: sudo apt-get install -y ninja-build clang lld llvm | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
|
@@ -269,7 +388,6 @@ jobs: | |
- name: Ccache for C++ compilation | ||
if: steps.changed-files.outputs.changed-files != '' | ||
# https://github.com/hendrikmuhs/ccache-action/releases/tag/v1.2.9 | ||
uses: hendrikmuhs/ccache-action@ca3acd2731eef11f1572ccb126356c2f9298d35e | ||
with: | ||
key: ${{ runner.os }}-${{ matrix.ubuntu_version }}-${{ steps.get-llvm-commit-hash.outputs.hash }}-code-cov | ||
|
@@ -335,95 +453,3 @@ jobs: | |
body-path: /home/runner/work/mlir-aie/mlir-aie/build_release/report/index.html | ||
edit-mode: replace | ||
|
||
CppFormatting: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Get the project repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
submodules: "true" | ||
|
||
- name: Install clang-format | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
clangformat: 17.0.1 | ||
|
||
- name: Setup Python env | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Run git-clang-format | ||
id: git-clang-format | ||
run: | | ||
git fetch origin main | ||
FORMATTED=0 | ||
git clang-format origin/main || FORMATTED=$? | ||
echo "FORMATTED=$FORMATTED" | tee -a $GITHUB_OUTPUT | ||
- name: Annotate diff changes using reviewdog | ||
if: steps.git-clang-format.outputs.FORMATTED != '0' | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: clang-format | ||
|
||
- name: Fail | ||
if: steps.git-clang-format.outputs.FORMATTED != '0' | ||
run: | | ||
exit 1 | ||
PythonFormatting: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Get the project repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
submodules: "true" | ||
|
||
- name: Install clang-format | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
clangformat: 17.0.1 | ||
|
||
- name: Setup Python env | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install black | ||
run: pip install black | ||
|
||
- name: Run black format | ||
id: black-format | ||
run: | | ||
FORMATTED=0 | ||
black . || FORMATTED=$? | ||
FORMATTED=$($FORMATTED || git status -s -uno | wc -l | xargs) | ||
echo "FORMATTED=$FORMATTED" | tee -a $GITHUB_OUTPUT | ||
git diff | ||
- name: Annotate diff changes using reviewdog | ||
if: steps.black-format.outputs.FORMATTED != '0' | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: black | ||
|
||
- name: Fail | ||
if: steps.black-format.outputs.FORMATTED != '0' | ||
run: | | ||
exit 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[MAIN] | ||
|
||
py-version=3.9 | ||
|
||
[BASIC] | ||
|
||
argument-naming-style=snake_case | ||
attr-naming-style=snake_case | ||
bad-names=foo, | ||
bar, | ||
baz, | ||
toto, | ||
tutu, | ||
tata | ||
|
||
class-attribute-naming-style=snake_case | ||
class-const-naming-style=UPPER_CASE | ||
class-naming-style=PascalCase | ||
const-naming-style=UPPER_CASE | ||
docstring-min-length=-1 | ||
function-naming-style=snake_case | ||
include-naming-hint=yes | ||
inlinevar-naming-style=snake_case | ||
method-naming-style=snake_case | ||
module-naming-style=snake_case | ||
variable-naming-style=snake_case | ||
|
||
[CLASSES] | ||
|
||
valid-classmethod-first-arg=cls | ||
valid-metaclass-classmethod-first-arg=mcs | ||
|
||
[IMPORTS] | ||
|
||
allow-wildcard-with-all=no | ||
|
||
[SIMILARITIES] | ||
|
||
# Minimum lines number of a similarity. | ||
min-similarity-lines=4 | ||
|
||
[STRING] | ||
|
||
# This flag controls whether inconsistent-quotes generates a warning when the | ||
# character used as a quote delimiter is used inconsistently within a module. | ||
check-quote-consistency=yes | ||
|
||
# This flag controls whether the implicit-str-concat should generate a warning | ||
# on implicit string concatenation in sequences defined over several lines. | ||
check-str-concat-over-line-jumps=yes | ||
|
||
[MESSAGES CONTROL] | ||
|
||
# C0116: Missing function or method docstring (missing-function-docstring) | ||
# C0114: Missing module docstring (missing-module-docstring) | ||
# E0402: Attempted relative import beyond top-level package (relative-beyond-top-level) | ||
# C0115: Missing class docstring (missing-class-docstring) | ||
disable=C0116,C0114,E0402,C0115 |
Oops, something went wrong.