File tree Expand file tree Collapse file tree 3 files changed +53
-30
lines changed
devops/actions/clang-format Expand file tree Collapse file tree 3 files changed +53
-30
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ name : SYCL
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - sycl
7
+
8
+ jobs :
9
+ lint :
10
+ # TODO use nightly builds of SYCL to get clang-format
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Get clang-format first
14
+ run : sudo apt-get install -yqq clang-format
15
+
16
+ - uses : actions/checkout@v2
17
+ with :
18
+ fetch-depth : 2
19
+
20
+ - name : Run clang-format
21
+ uses : ./devops/actions/clang-format
22
+
23
+ linux_default :
24
+ name : Default Linux
25
+ # Only build and test patches, that have passed all linter checks, because
26
+ # the next commit is likely to be a follow-up on that job.
27
+ needs : lint
28
+ if : always() && (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
29
+ uses : intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@sycl
30
+ with :
31
+ build_runs_on : " sycl-precommit-linux"
32
+ build_cache_root : " /__w/"
33
+ build_cache_size : " 8G"
34
+ build_artifact_suffix : " default"
35
+ build_cache_suffix : " default"
36
+
Original file line number Diff line number Diff line change
1
+ name : ' clang-format'
2
+ description : ' Run clang-format on pull request'
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - name : Run clang-format for the patch
7
+ shell : bash
8
+ run : |
9
+ git diff --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} --name-only -- | grep -v "/test/" | xargs git diff -U0 --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} -- | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format > ./clang-format.patch
10
+ # Add patch with formatting fixes to CI job artifacts
11
+ - uses : actions/upload-artifact@v1
12
+ with :
13
+ name : clang-format-patch
14
+ path : ./clang-format.patch
15
+ - name : Check if clang-format patch is empty
16
+ shell : bash
17
+ run : bash -c "if [ -s ./clang-format.patch ]; then cat ./clang-format.patch; exit 1; fi"
You can’t perform that action at this time.
0 commit comments