Skip to content

Commit d6b1a8a

Browse files
committed
CI/Makefile: add build-tests target to have a uniform UX
1 parent 65f8b73 commit d6b1a8a

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,7 @@ jobs:
215215
cache-prefix: build-tests-${{ matrix.os }}-v0
216216

217217
- name: Build tests
218-
run: |
219-
mkdir -p target/release/tests
220-
221-
cargo build --release --tests --package=openmina-node-testing --package=cli
222-
cargo build --release --tests --package=openmina-node-testing --package=cli --message-format=json > cargo-build-test.json
223-
jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' cargo-build-test.json > tests.tsv
224-
while read NAME FILE; do cp -a $FILE target/release/tests/$NAME; done < tests.tsv
218+
run: make build-tests
225219

226220
- name: Upload tests
227221
if: matrix.os == 'ubuntu-22.04'

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ build-release: ## Build the project in release mode
4545
build-testing: ## Build the testing binary with scenario generators
4646
cargo build --release --features scenario-generators --bin openmina-node-testing
4747

48+
.PHONY: build-tests
49+
build-tests: ## Build tests for scenario testing
50+
@mkdir -p target/release/tests
51+
@cargo build --release --tests \
52+
--package=openmina-node-testing \
53+
--package=cli
54+
@cargo build --release --tests \
55+
--package=openmina-node-testing \
56+
--package=cli \
57+
--message-format=json > cargo-build-test.json
58+
@jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' \
59+
cargo-build-test.json > tests.tsv
60+
@while read NAME FILE; do \
61+
cp -a $$FILE target/release/tests/$$NAME; \
62+
done < tests.tsv
63+
4864
.PHONY: build-tests-webrtc
4965
build-tests-webrtc: ## Build tests for WebRTC
5066
@mkdir -p target/release/tests

0 commit comments

Comments
 (0)