diff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.yml index 0a70703420c1..79d7c85a0e72 100644 --- a/.github/workflows/cypress-tests-runner.yml +++ b/.github/workflows/cypress-tests-runner.yml @@ -394,7 +394,7 @@ jobs: if: ${{ env.RUN_TESTS == 'true' }} env: RUSTFLAGS: "-Cinstrument-coverage" - run: cargo build --package router --bin router --no-default-features --features=customer_v2,payment_methods_v2,v2 --jobs 3 + run: just build_v2 - name: Delete compile-time profraw files if: ${{ env.RUN_TESTS == 'true' }} diff --git a/justfile b/justfile index 43fca4afc893..04fd57cfb51c 100644 --- a/justfile +++ b/justfile @@ -64,6 +64,21 @@ check_v2 *FLAGS: cargo check {{ check_flags }} --no-default-features --features "${FEATURES}" -- {{ FLAGS }} set +x +build_v2: + #! /usr/bin/env bash + set -euo pipefail + + FEATURES="$(cargo metadata --all-features --format-version 1 --no-deps | \ + jq -r ' + [ .packages[] | select(.name == "router") | .features | keys[] # Obtain features of `router` package + | select( any( . ; test("(([a-z_]+)_)?v2") ) ) ] # Select v2 features + | join(",") # Construct a comma-separated string of features for passing to `cargo` + ')" + + set -x + cargo build --package router --bin router --no-default-features --features "${FEATURES}" + set +x + run_v2: #! /usr/bin/env bash set -euo pipefail