Skip to content

Commit

Permalink
use CARGO env if avaliable
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <[email protected]>
  • Loading branch information
jsturtevant committed Oct 20, 2023
1 parent 53f43df commit a9ba823
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/action-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
timeout-minutes: 5
run: |
make test-${{ inputs.runtime }}
with:
CARGO_TARGET_DIR: /target
- name: Package artifacts
if: ${{ inputs.runtime != 'common' }}
shell: bash
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ LN ?= ln -sf
TEST_IMG_NAME ?= wasmtest:latest
RUNTIMES ?= wasmedge wasmtime wasmer
CONTAINERD_NAMESPACE ?= default
CARGO_TARGET_DIR?=./target

ifeq ($(CARGO),cross)
# Set the default target as defined in Cross.toml
TARGET ?= $(shell uname -m)-unknown-linux-musl
TARGET_DIR=./target/build/$(TARGET)
TARGET_DIR=$(CARGO_TARGET_DIR)/build/$(TARGET)
# When using `cross` we need to run the tests outside the `cross` container.
# We stop `cargo test` from running the tests with the `--no-run` flag.
# We then need to run the generate test binary manually.
Expand All @@ -19,7 +20,7 @@ TEST_ARGS_SEP= --no-run --color=always --message-format=json | \
xargs -I_ ./scripts/test-runner.sh ./_
else
TARGET ?= $(shell rustc --version -v | sed -En 's/host: (.*)/\1/p')
TARGET_DIR ?= ./target
TARGET_DIR ?= $(CARGO_TARGET_DIR)
TEST_ARGS_SEP= --
endif

Expand Down

0 comments on commit a9ba823

Please sign in to comment.