From 916d0c041028d876f1fc66f8b936769737e2a6f1 Mon Sep 17 00:00:00 2001 From: Oleg Kulachenko Date: Thu, 19 Oct 2023 18:39:54 +0400 Subject: [PATCH 1/2] Fix paths to files Now this composite action can be used correctly in other actions. Signed-off-by: Oleg Kulachenko --- action.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 91a7e53..467a52e 100644 --- a/action.yml +++ b/action.yml @@ -68,15 +68,18 @@ runs: shell: bash env: NEOFS_WALLET: ${{ inputs.NEOFS_WALLET }} + GITHUB_ACTION_PATH: ${{ github.action_path }} run: | - echo "$NEOFS_WALLET" | base64 -d > wallet.json + echo "$NEOFS_WALLET" | base64 -d > "$GITHUB_ACTION_PATH/wallet.json" - name: Prepare venv shell: bash id: prepare_venv + env: + GITHUB_ACTION_PATH: ${{ github.action_path }} run: | - python3 -m venv venv - source venv/bin/activate && pip install -r requirements.txt + python3 -m venv "$GITHUB_ACTION_PATH/venv" + source "$GITHUB_ACTION_PATH/venv/bin/activate" && pip install -r "$GITHUB_ACTION_PATH/requirements.txt" - name: Put files to NeoFS shell: bash @@ -90,10 +93,12 @@ runs: NEOFS_ATTRIBUTES: ${{ inputs.NEOFS_ATTRIBUTES }} URL_PREFIX: ${{ inputs.URL_PREFIX }} LIFETIME: ${{ inputs.LIFETIME }} + GITHUB_ACTION_PATH: ${{ github.action_path }} run: | - source venv/bin/activate && NEOFS_CLI_PASSWORD=$NEOFS_WALLET_PASSWORD python ./push-to-neofs.py \ + source "$GITHUB_ACTION_PATH/venv/bin/activate" && NEOFS_CLI_PASSWORD=$NEOFS_WALLET_PASSWORD python "$GITHUB_ACTION_PATH/push-to-neofs.py" \ --lifetime "$LIFETIME" --neofs_domain "$NEOFS_NETWORK_DOMAIN" --attributes "$NEOFS_ATTRIBUTES" \ - --cid "$STORE_OBJECTS_CID" --files-dir "$PATH_TO_FILES_DIR" --url_path_prefix "$URL_PREFIX" --wallet wallet.json + --cid "$STORE_OBJECTS_CID" --files-dir "$PATH_TO_FILES_DIR" --url_path_prefix "$URL_PREFIX" \ + --wallet "$GITHUB_ACTION_PATH/wallet.json" BASE_URL="https://$NEOFS_HTTP_GATE/$STORE_OBJECTS_CID" if [ -z "$URL_PREFIX" ]; then echo "container_url=$BASE_URL/" >> $GITHUB_OUTPUT From 2756523a7cdd7ed843f1d6feb2a78153637eea36 Mon Sep 17 00:00:00 2001 From: Oleg Kulachenko Date: Tue, 24 Oct 2023 01:50:18 +0400 Subject: [PATCH 2/2] Fixed test falling Test with incorrect parameter falls instead of being skipped. Signed-off-by: Oleg Kulachenko --- tests/test_downloads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_downloads.py b/tests/test_downloads.py index 4175147..c84d1e9 100644 --- a/tests/test_downloads.py +++ b/tests/test_downloads.py @@ -22,7 +22,7 @@ def download_file(url: str) -> str: ) def test_file_content(base_url, report_dir, path): if base_url is None: - pytest.skip("base_url is not provided. Provide it using --base_url option.") + pytest.fail("base_url is not provided. Provide it using --base_url option.") if not base_url.endswith("/"): base_url += "/"