-
Notifications
You must be signed in to change notification settings - Fork 1.1k
60 lines (58 loc) · 3.29 KB
/
presubmit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Halide Presubmit Checks
on:
# We don't want 'edited' (that's basically just the description, title, etc)
# We don't want 'review_requested' (that's redundant to the ones below for our purposes)
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.h'
- '**.c'
- '**.cpp'
permissions:
contents: read
jobs:
check_clang_format:
name: Check clang-format
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.16.2
with:
source: '.'
extensions: 'h,c,cpp'
clangFormatVersion: 16
check_clang_tidy:
name: Check clang-tidy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install clang-tidy
run: |
# from apt.llvm.org
# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
sudo apt-add-repository "deb https://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-16 main"
sudo apt-get update
sudo apt-get install llvm-16 clang-16 liblld-16-dev libclang-16-dev clang-tidy-16 ninja-build flatbuffers-compiler flatbuffers-compiler-dev libflatbuffers-dev libflatbuffers1
- name: Run clang-tidy
run: |
export CC=clang-16
export CXX=clang++-16
export CLANG_TIDY_LLVM_INSTALL_DIR=/usr/lib/llvm-16
./run-clang-tidy.sh
check_cmake_file_lists:
name: Check CMake file lists
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Run test sources check
run: |
shopt -s nullglob
(cd test/autoschedulers/li2018 && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])
(cd test/autoschedulers/mullapudi2016 && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])
(cd test/correctness && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])
(cd test/error && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])
(cd test/generator && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])
(cd test/failing_with_issue && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])
(cd test/performance && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])
(cd test/warning && comm -23 <(ls *.{c,cpp} | sort) <(grep -P '^\s*#?\s*[A-Za-z0-9_.]+$' CMakeLists.txt | tr -d '# ' | sort) | tee missing_files && [ ! -s missing_files ])