Skip to content

Commit c33c263

Browse files
committed
Add test
1 parent af136ca commit c33c263

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

.github/workflows/test-download-hz-dist.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ jobs:
1717

1818
- name: Download ${{ matrix.distribution }}"
1919
uses: ./download-hz-dist
20+
id: download
2021
with:
2122
repo-vars-as-json: "{\n \"MAVEN_EE_RELEASE_REPO\": \"https://repository.hazelcast.com/release\",\n \"MAVEN_OSS_RELEASE_REPO\": \" \"\n}"
2223
distribution: "${{ matrix.distribution }}"
2324
hz_version: "5.0"
2425
classifier: "slim"
2526
packaging: "tar.gz"
26-
output_file: "distribution"
27+
28+
- name: Check file exists
29+
run: |
30+
if [[ ! -f "${{ steps.download.outputs.output_file }}" ]]; then
31+
echo "${{ steps.download.outputs.output_file }} not found!"
32+
exit 1
33+
fi

.github/workflows/test-get-hz-versions.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ jobs:
3131
assert_eq "$expected" "$actual" "$msg" && log_success "$msg" || TESTS_RESULT=$?
3232
}
3333
34-
assert_populated() {
35-
local name=$1
36-
local actual=$2
37-
local msg="$name should not be empty"
38-
assert_not_empty "$actual" "$msg" && log_success "$msg" || TESTS_RESULT=$?
39-
}
40-
4134
assert_equals "HZ_VERSION" "1.2.3" "${{ steps.hz_versions.outputs.HZ_VERSION }}"
4235
4336
assert_eq 0 "$TESTS_RESULT" "All tests should pass"

download-hz-dist/action.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ inputs:
1616
description: 'Maven packaging'
1717
required: true
1818
output_file:
19-
description: 'Path to the output file, if not defaults to "distribution"'
19+
description: 'Path to the output file'
2020
required: false
2121
outputs:
2222
maven_repo_url:
2323
description: 'The Maven repository root URL used to download the distribution'
2424
value: ${{ steps.get_repo_url.outputs.repo_url }}
25+
output_file:
26+
description: 'Path to the downloaded file'
27+
value: ${{ steps.derive-output-file.outputs.file }}
2528
runs:
2629
using: "composite"
2730
steps:
@@ -53,6 +56,12 @@ runs:
5356
# Lookup up the value of the selected key in "repo-vars-as-json"
5457
echo "repo_url=$(jq --raw-output .${repo_var_name} <<< '${{ inputs.repo-vars-as-json }}')" >> ${GITHUB_OUTPUT}
5558
59+
- name: Derive output file
60+
id: derive-output-file
61+
shell: bash
62+
run: |
63+
echo "file=${{ inputs.output_file || format('distribution.{0}', inputs.packaging) }}" >> ${GITHUB_OUTPUT}
64+
5665
- name: Download via Maven
5766
shell: bash
5867
run: |
@@ -65,6 +74,6 @@ runs:
6574
-Dclassifier="${{ inputs.classifier }}" \
6675
-Dpackaging="${{ inputs.packaging }}" \
6776
-Dtransitive=false \
68-
-Ddest="${{ inputs.output_file || format('distribution.{0}', inputs.packaging) }}" \
77+
-Ddest="${{ steps.derive-output-file.outputs.file }}" \
6978
--batch-mode \
7079
--no-transfer-progress

0 commit comments

Comments
 (0)