Skip to content

Commit

Permalink
Split in 4 test
Browse files Browse the repository at this point in the history
  • Loading branch information
ii-cruz committed Jul 22, 2024
1 parent 9f1c11f commit c44c38b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- CodeCov1
- CodeCov2
- CodeCov3
- CodeCov4

include:
- test: CodeCov1
Expand All @@ -22,6 +23,8 @@ jobs:
args: second_peace
- test: CodeCov3
args: third_peace
- test: CodeCov4
args: fourth_peace

runs-on: ubuntu-22.04

Expand Down Expand Up @@ -72,24 +75,25 @@ jobs:
# fetch all package names
pkg_names=($(cargo build -p 2>&1 | grep ' ' | cut -c 5-))
# find splitting package indexes
num_pkgs=${#pkg_names[@]}
pkgs_split=$(expr $num_pkgs / 3)
last_splitting_point=$(($pkgs_split * 2))
pkgs_split=$(expr $num_pkgs / 4)
# sets the packages to run for both code cov runs
first_peace=${pkg_names[@]:0:$pkgs_split}
second_peace=${pkg_names[@]:$pkgs_split:$pkgs_split}
third_peace=${pkg_names[@]:$last_splitting_point:$num_pkgs}
third_peace=${pkg_names[@]:$(($pkgs_split * 2)):$pkgs_split}
fourth_peace=${pkg_names[@]:$(($pkgs_split * 3)):$num_pkgs}
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')
fourth_peace=$(echo $fourth_peace | xargs printf -- '-p %s\n')
echo $first_peace
echo $second_peace
echo $third_peace
echo $fourth_peace
set -o pipefail
echo $${{matrix.args}} | xargs cargo llvm-cov nextest --features=nimiq-zkp-component/test-prover
Expand Down

0 comments on commit c44c38b

Please sign in to comment.