Skip to content

Commit

Permalink
Split code cov in 3 tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
ii-cruz committed Jul 22, 2024
1 parent 348fdbf commit 9f1c11f
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ jobs:
test:
- CodeCov1
- CodeCov2
- CodeCov3

include:
- test: CodeCov1
args: first_half
args: first_peace
- test: CodeCov2
args: second_half
args: second_peace
- test: CodeCov3
args: third_peace

runs-on: ubuntu-22.04

Expand Down Expand Up @@ -69,20 +72,25 @@ jobs:
# fetch all package names
pkg_names=($(cargo build -p 2>&1 | grep ' ' | cut -c 5-))
# find the middle package index
# find splitting package indexes
num_pkgs=${#pkg_names[@]}
half_pkgs=$(expr $num_pkgs / 2)
pkgs_split=$(expr $num_pkgs / 3)
last_splitting_point=$(($pkgs_split * 2))
# sets the packages to run for both code cov runs
first_half=${pkg_names[@]:0:$half_pkgs}
second_half=${pkg_names[@]:$half_pkgs:$num_pkgs}
first_peace=${pkg_names[@]:0:$pkgs_split}
second_peace=${pkg_names[@]:$pkgs_split:$pkgs_split}
third_peace=${pkg_names[@]:$last_splitting_point:$num_pkgs}
first_half=$(echo $first_half | xargs printf -- '-p %s\n')
second_half=$(echo $second_half | xargs printf -- '-p %s\n')
echo $first_half
echo $second_half
first_peace=$(echo $first_peace | xargs printf -- '-p %s\n')
second_peace=$(echo $second_peace | xargs printf -- '-p %s\n')
third_peace=$(echo $third_peace | xargs printf -- '-p %s\n')
echo $first_peace
echo $second_peace
echo $third_peace
set -o pipefail
echo $${{matrix.args}} | xargs cargo llvm-cov nextest --features=nimiq-zkp-component/test-prover
# Fixme: --doctest is not supported in stable. See:
Expand Down

0 comments on commit 9f1c11f

Please sign in to comment.