Enhance tests with download checkup
Some checks failed
/ GenerateReleaseZipfile (push) Failing after 1m9s
Some checks failed
/ GenerateReleaseZipfile (push) Failing after 1m9s
This commit is contained in:
parent
064aef7815
commit
f06c2ae6bf
2 changed files with 30 additions and 19 deletions
|
@ -21,24 +21,6 @@ jobs:
|
||||||
echo ratata >> 'tutu tutu*.txt'
|
echo ratata >> 'tutu tutu*.txt'
|
||||||
ls -R
|
ls -R
|
||||||
|
|
||||||
- name: little test
|
|
||||||
run: |
|
|
||||||
printf "url:\n%s\n%s\n%s\nThe end." \
|
|
||||||
"${{ github.server_url }}" \
|
|
||||||
"${{ github.repository }}" \
|
|
||||||
"${{ github.sha }}"
|
|
||||||
printf "mytest: %s\n" "$MYTEST"
|
|
||||||
printf "mytest2: %s\n" "${{ github.env.MYTEST }}"
|
|
||||||
printf "shapr: %s\n" "$SHAPR"
|
|
||||||
printf "shagh: %s\n" "$SHAGH"
|
|
||||||
printf "FULL_URL: %s\n" "$FULL_URL"
|
|
||||||
env:
|
|
||||||
RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
||||||
SHAPR: ${{ github.event.pull_request.head.sha }}
|
|
||||||
SHAGH: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
||||||
MYTEST: "${{ github.server_url }}/${{ github.repository }}@${{ github.env.RELEVANT_SHA }}"
|
|
||||||
FULL_URL: "${{ github.server_url }}/${{ github.repository }}@${{ github.sha }}"
|
|
||||||
|
|
||||||
- name: Testing the artifact uploading
|
- name: Testing the artifact uploading
|
||||||
id: "uploading"
|
id: "uploading"
|
||||||
uses: "${{ github.server_url }}/${{ github.repository }}@${{ github.sha }}"
|
uses: "${{ github.server_url }}/${{ github.repository }}@${{ github.sha }}"
|
||||||
|
@ -51,3 +33,30 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
printf "steps.uploading.outputs.artifact-id: %s\n" "${{ steps.uploading.outputs.artifact-id }}"
|
printf "steps.uploading.outputs.artifact-id: %s\n" "${{ steps.uploading.outputs.artifact-id }}"
|
||||||
|
printf "steps.uploading.outputs.artifact-url: %s\n" "${{ steps.uploading.outputs.artifact-url }}"
|
||||||
|
|
||||||
|
- name: Check the content of the uploaded artifact
|
||||||
|
run: |
|
||||||
|
# Stop at first error and be verbose
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Create some temporary files/directory
|
||||||
|
DOWNLOAD_FILE="$( mktemp )"
|
||||||
|
SHASUM_FILE="$( mktemp )"
|
||||||
|
TEST_ARTIFACT_DIR="$( mktemp -d )"
|
||||||
|
|
||||||
|
# Get the fingerprint of our test
|
||||||
|
sha256sum . > "$SHASUM_FILE"
|
||||||
|
# Little optional checkup
|
||||||
|
cat "$SHASUM_FILE"
|
||||||
|
|
||||||
|
cd "$TEST_ARTIFACT_DIR"
|
||||||
|
wget -O "$DOWNLOAD_FILE" "${{ steps.uploading.outputs.artifact-url }}"
|
||||||
|
unzip "$DOWNLOAD_FILE"
|
||||||
|
sha256 -c "$SHASUM_FILE"
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
cd -
|
||||||
|
rm -f "$DOWNLOAD_FILE"
|
||||||
|
rm -f "$SHASUM_FILE"
|
||||||
|
rm -rf "$TEST_ARTIFACT_DIR"
|
||||||
|
|
|
@ -91,7 +91,9 @@ runs:
|
||||||
)"
|
)"
|
||||||
|
|
||||||
# Store the outputs
|
# Store the outputs
|
||||||
echo artifact-id="$( echo "$RESPONSE" | sed -n 's/.*"artifactId" *: *"\([^"]\+\)".*/\1/p' )" >> $GITHUB_OUTPUT
|
ARTIFACT_ID="$( echo "$RESPONSE" | sed -n 's/.*"artifactId" *: *"\([^"]\+\)".*/\1/p' )"
|
||||||
|
echo artifact-id="$ARTIFACT_ID" >> $GITHUB_OUTPUT
|
||||||
|
echo artifact-url="$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"/actions/runs/"$GITHUB_RUN_ID"/artifacts/"$ARTIFACT_ID" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
if [ "${{ inputs.compression }}" == "true" ]; then
|
if [ "${{ inputs.compression }}" == "true" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue