Skip to content

Commit

Permalink
fix: support custom binary path
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Aug 7, 2023
1 parent 465d7a6 commit b33d85a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ jobs:
with:
command: run ./cwd.yml
working-directory: ./my-dir
- name: Cleanup
run: rm -rf ./my-dir

# Supports custom Artillery binary path.
# Useful to test against intermediate builds of Artillery.
- name: Prepare custom binary
run: echo "echo \"$1\" >> \"output.txt\"" >> ./custom-binary.sh
- name: Supports custom Artillery binary
uses: ./
with:
command: hello
env:
ARTILLERY_BINARY_PATH: ./custom-binary.sh
- name: Check the output
run: '[[ "$(cat ./output.txt)" == "hello" ]] || exit 1'
- name: Cleanup
run: rm ./custom-binary.sh

release:
if: github.ref == 'refs/heads/main'
Expand Down
13 changes: 12 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@ if [ -n "${CWD}" ]; then
cd "${CWD}"
fi

if [ -n "${ARTILLERY_BINARY_PATH}" ]; then
if [ ! -f "${ARTILLERY_BINARY_PATH}" ]; then
echo "Failed to locate Artillery binary at custom path: ${ARTILLERY_BINARY_PATH}"
exit 1
fi

ARTILLERY_BINARY="${ARTILLERY_BINARY_PATH}"
else
ARTILLERY_BINARY="/home/node/artillery/bin/run"
fi

# Run the tests.
/home/node/artillery/bin/run $1
$ARTILLERY_BINARY $1

0 comments on commit b33d85a

Please sign in to comment.