# 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/.
---
loader: taskgraph.loader.transform:loader

kind-dependencies:
    - fetch
    - toolchain

transforms:
    - gecko_taskgraph.transforms.build_attrs:transforms
    - gecko_taskgraph.transforms.build_schedules:transforms
    - gecko_taskgraph.transforms.build_lints:transforms
    - gecko_taskgraph.transforms.job:transforms
    - gecko_taskgraph.transforms.task:transforms

task-defaults:
    run-on-repo-type: [hg]
    attributes:
        retrigger: true
    index:
        product: firefox
    worker:
        skip-artifacts: true
        max-run-time: 3600
        env:
            PERFHERDER_EXTRA_OPTIONS: static-analysis-autotest
    use-python: default
    run-on-projects: ['mozilla-central']
    run:
        using: mozharness
        actions: [static-analysis-autotest]
        script: mozharness/scripts/fx_desktop_build.py
    treeherder:
        symbol: Sa
        kind: build
        tier: 1

tasks:
    linux64-st-autotest/debug:
        description: "Linux64 Debug Static Analysis Autotest"
        index:
            job-name: linux64-st-autotest-debug
        treeherder:
            platform: linux64/debug
        worker-type: t-linux-docker-amd
        worker:
            docker-image: {in-tree: static-analysis-build}
            env:
                # clang-tidy needs a recent libstdc++, which can be found in the clang
                # toolchain.
                LD_LIBRARY_PATH: /builds/worker/checkouts/gecko/clang/lib
                PERFHERDER_EXTRA_OPTIONS: static-analysis-autotest
        run:
            config:
                - builds/releng_base_firefox.py
                - builds/releng_sub_linux_configs/64_stat_and_debug.py
            tooltool-downloads: public
            keep-artifacts: false
        use-sccache: true
        fetches:
            toolchain:
                - linux64-clang
                - linux64-clang-tidy
                - linux64-rust
                - linux64-sccache
                - linux64-cbindgen
                - linux64-nasm
                - linux64-node
                - linux64-pkgconf
                - sysroot-x86_64-linux-gnu
                - sysroot-wasm32-wasi

    win64-st-autotest/debug:
        description: "Win64 Debug Static Analysis Autotest"
        index:
            job-name: win64-st-autotest-debug
        treeherder:
            platform: windows2012-64/debug
            tier: 2
        worker-type: b-win2022
        run:
            config:
                - builds/releng_base_firefox.py
                - builds/taskcluster_base_windows.py
                - builds/taskcluster_base_win64.py
                - builds/taskcluster_sub_win64/debug.py
            extra-config:
                mozconfig_variant: debug
        use-sccache: false
        fetches:
            toolchain:
                - win64-clang
                - win64-rust
                - win64-cbindgen
                - win64-clang-tidy
                - win64-nasm
                - win64-node
                - win64-dump_syms
                - win64-winchecksec
                - vs
                - sysroot-wasm32-wasi
                - winappsdk-x86_64-pc-windows-msvc
            fetch:
                - windows-rs
