summaryrefslogtreecommitdiffstats
path: root/taskcluster/kinds/source-test/clang.yml
blob: d77066afe796e9aa68d887b0e4e50a13fcd8a6fa (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
job-defaults:
    run-on-projects: ["trunk"]
    platform: linux64/debug
    worker-type: t-linux-xlarge-source
    attributes:
        code-review: true
    worker:
        docker-image: {in-tree: static-analysis-build}
        max-run-time: 5400
    treeherder:
        kind: other
        tier: 2
    run:
        using: run-task
        tooltool-downloads: public
    fetches:
        toolchain:
            - linux64-cbindgen
            - linux64-nasm
            - linux64-node
    when:
        files-changed:
            - '**/*.c'
            - '**/*.cpp'
            - '**/*.cc'
            - '**/*.cxx'
            - '**/*.m'
            - '**/*.mm'

tidy:
    description: Run static-analysis (clang-tidy) on C/C++ patches
    treeherder:
        symbol: cpp(clang-tidy)
    run:
        cwd: '{checkout}'
        command: >-
            source taskcluster/scripts/misc/source-test-clang-setup.sh &&
            ./mach --log-no-times static-analysis check --outgoing --output $HOME/clang-tidy.json --format json
    fetches:
        toolchain:
            - linux64-clang
            - linux64-clang-tidy
            - linux64-rust
            - sysroot-x86_64-linux-gnu
            - sysroot-wasm32-wasi
    worker:
        artifacts:
            - type: file
              name: public/code-review/clang-tidy.json
              path: /builds/worker/clang-tidy.json

format:
    description: Run clang-format on C/C++ patches
    treeherder:
        symbol: cpp(clang-format)
    # Run only on try and code-review tasks
    # to avoid running clang format on the whole codebase
    run-on-projects: []
    run:
        cwd: '{checkout}'
        command: >-
            source taskcluster/scripts/misc/source-test-clang-setup.sh &&
            ./mach --log-no-times clang-format --outgoing --output $HOME/clang-format.json --format json &&
            ./mach --log-no-times clang-format --outgoing --output $HOME/clang-format.diff --format diff
    fetches:
        toolchain:
            - linux64-clang
            - linux64-clang-tidy
            - linux64-rust
            - sysroot-x86_64-linux-gnu
            - sysroot-wasm32-wasi
    when:
        files-changed:
            - '**/*.c'
            - '**/*.cpp'
            - '**/*.cc'
            - '**/*.cxx'
            - '**/*.m'
            - '**/*.mm'
            - '**/*.h'
            - '**/*.hh'
            - '**/*.hpp'
            - '**/*.hxx'
    worker:
        artifacts:
            - type: file
              name: public/code-review/clang-format.json
              path: /builds/worker/clang-format.json
            - type: file
              name: public/code-review/clang-format.diff
              path: /builds/worker/clang-format.diff

external:
    description: Run static-analysis (clang-tidy) on C/C++ patches with external checks
    treeherder:
        symbol: cpp(clang-tidy-external)
    run:
        cwd: '{checkout}'
        command: >-
            source taskcluster/scripts/misc/source-test-clang-setup.sh &&
            ./mach --log-no-times static-analysis check --checks="-*,mozilla-civet-*" --outgoing --output $HOME/clang-tidy.json --format json
    fetches:
        toolchain:
            - linux64-clang
            - linux64-clang-tidy-external
            - linux64-rust
            - sysroot-x86_64-linux-gnu
            - sysroot-wasm32-wasi
    worker:
        artifacts:
            - type: file
              name: public/code-review/clang-tidy.json
              path: /builds/worker/clang-tidy.json