Skip to content

Commit

Permalink
Added 'build_v2' to justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuthaDev committed Dec 23, 2024
1 parent 68e18d4 commit bfa2b0c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/cypress-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
15 changes: 15 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfa2b0c

Please sign in to comment.