Skip to content

Commit

Permalink
CI-jobs-over-time: sync with source repo PR #5124
Browse files Browse the repository at this point in the history
Since it changes the github file to use "matrix" style.

PR 5124: curl/curl#5124
Closes #6
  • Loading branch information
bagder committed Mar 24, 2020
1 parent ac6ae20 commit fa8b408
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions CI-jobs-over-time.pl
Expand Up @@ -39,22 +39,37 @@ sub tag2date {
return $d;
}

#$travisbuilds=`grep -c -e "- os:" .travis.yml`;
#$cirrusbuilds=`grep -c image_family .cirrus.yml`;
#$appveyorbuilds=`grep -c "APPVEYOR_BUILD_WORKER_IMAGE" appveyor.yml`;
#$azurebuilds=`grep -c -e " - job:" .azure-pipelines.yml`;
#$githubbuilds=`grep runs-on .github/workflows/* | wc -l`;

sub githubcount {
my ($tag)=@_;
my @files= `git ls-files -- .github/workflows 2>/dev/null`;
my $c = 0;
foreach my $f (@files) {
chomp $f;
my $matrix = 0;
if($f =~ "/macos.yml") {
# this introduced the use of the matrix style
$matrix = 1;
}
open(G, "git show $tag:$f 2>/dev/null|");
while(<G>) {
if($_ =~ /^ runs-on:/) {
$c++;
if(!$matrix) {
while(<G>) {
if($_ =~ /^ runs-on:/) {
$c++;
}
}
}
else {
my $mult = 0;
while(<G>) {
if($_ =~ /matrix:/) {
$mult = 0;
}
elsif($_ =~ /- name:/) {
$c += ($mult?$mult:1);
}
elsif($_ =~ /- CC:/) {
$mult++;
}
}
}
close(G);
Expand Down

0 comments on commit fa8b408

Please sign in to comment.