xref: /aosp_15_r20/external/skia/infra/bots/analysis/create-alljobs.sh (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1#!/bin/bash
2# Copyright 2021 Google Inc.
3#
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7# Create a file /tmp/alljobs.csv by parsing jobs.json.
8
9set -e
10
11# Write the starting set of headers.
12echo Type,os,compiler,model,cpu_or_gpu,cpu_or_gpu_value,arch,configuration,test_filter,extra > /tmp/alljobs.csv
13
14# Extract the CSV values from the jobs.json file.
15# The seds parse up the job names into columns, ensuring that every column has a value.
16cat ../jobs.json | jq .[] -r | grep "^[Perf|Test]" | sed "s#-#,#g" | sed "s#All\$#All,none#g" >> /tmp/alljobs.csv
17
18# Add the vulkan column.
19mlr --csv -I put '$vulkan=$extra =~ "Vulkan"' /tmp/alljobs.csv
20
21# Add the metal column.
22mlr --csv -I put '$metal=$extra =~ "Metal"' /tmp/alljobs.csv
23
24# Validate the output file is a valid CSV file.
25mlr --icsv check /tmp/alljobs.csv
26