Skip to content

Commit

Permalink
8295714: GHA ::set-output is deprecated and will be removed
Browse files Browse the repository at this point in the history
Reviewed-by: shade
  • Loading branch information
magicus committed Oct 21, 2022
1 parent dfd2d83 commit b35922b
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/actions/config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ runs:
run: |
# Extract value from configuration file
value="$(grep -h ${{ inputs.var }}= make/conf/github-actions.conf | cut -d '=' -f 2-)"
echo "::set-output name=value::$value"
echo "value=$value" >> $GITHUB_OUTPUT
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/do-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ runs:
$build_dir/make-support/failure-summary.log \
$build_dir/make-support/failure-logs/* \
failure-logs/ 2> /dev/null || true
echo '::set-output name=failure::true'
echo 'failure=true' >> $GITHUB_OUTPUT
fi
shell: bash

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/get-bootjdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
run: |
# Convert platform name to upper case
platform_prefix="$(echo ${{ inputs.platform }} | tr [a-z-] [A-Z_])"
echo "::set-output name=value::$platform_prefix"
echo "value=$platform_prefix" >> $GITHUB_OUTPUT
shell: bash

- name: 'Get URL configuration'
Expand Down Expand Up @@ -105,5 +105,5 @@ runs:
id: path-name
run: |
# Export the path
echo '::set-output name=path::bootjdk/jdk'
echo 'path=bootjdk/jdk' >> $GITHUB_OUTPUT
shell: bash
6 changes: 3 additions & 3 deletions .github/actions/get-bundles/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ runs:
tests_dir="$(cygpath $tests_dir)"
fi
echo "::set-output name=jdk::$jdk_dir"
echo "::set-output name=symbols::$symbols_dir"
echo "::set-output name=tests::$tests_dir"
echo "jdk=$jdk_dir" >> $GITHUB_OUTPUT
echo "symbols=$symbols_dir" >> $GITHUB_OUTPUT
echo "tests=$tests_dir" >> $GITHUB_OUTPUT
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/get-gtest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ runs:
id: path-name
run: |
# Export the path
echo '::set-output name=path::gtest'
echo 'path=gtest' >> $GITHUB_OUTPUT
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/get-jtreg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ runs:
id: path-name
run: |
# Export the path
echo '::set-output name=path::jtreg/installed'
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT
shell: bash
4 changes: 2 additions & 2 deletions .github/actions/upload-bundles/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ runs:
fi
if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$symbols_bundle$tests_bundle" != "" ]]; then
echo '::set-output name=bundles-found::true'
echo 'bundles-found=true' >> $GITHUB_OUTPUT
else
echo '::set-output name=bundles-found::false'
echo 'bundles-found=false' >> $GITHUB_OUTPUT
fi
shell: bash

Expand Down
7 changes: 4 additions & 3 deletions .github/scripts/gen-test-summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#

GITHUB_STEP_SUMMARY="$1"
GITHUB_OUTPUT="$2"

test_suite_name=$(cat build/run-test-prebuilt/test-support/test-last-ids.txt)
results_dir=build/run-test-prebuilt/test-results/$test_suite_name/text
Expand All @@ -41,12 +42,12 @@ error_count=$(echo $errors | wc -w || true)

if [[ "$failures" = "" && "$errors" = "" ]]; then
# We know something went wrong, but not what
echo '::set-output name=error-message::Unspecified test suite failure. Please see log for job for details.'
echo 'error-message=Unspecified test suite failure. Please see log for job for details.' >> $GITHUB_OUTPUT
exit 0
fi

echo '::set-output name=failure::true'
echo "::set-output name=error-message::Test run reported $failure_count test failure(s) and $error_count error(s). See summary for details."
echo 'failure=true' >> $GITHUB_OUTPUT
echo "error-message=Test run reported $failure_count test failure(s) and $error_count error(s). See summary for details." >> $GITHUB_OUTPUT

echo '### :boom: Test failures summary' >> $GITHUB_STEP_SUMMARY

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
run: |
# Set a proper suffix for packages if using a different architecture
if [[ '${{ inputs.apt-architecture }}' != '' ]]; then
echo '::set-output name=suffix:::${{ inputs.apt-architecture }}'
echo 'suffix=:${{ inputs.apt-architecture }}' >> $GITHUB_OUTPUT
fi
# Upgrading apt to solve libc6 installation bugs, see JDK-8260460.
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ jobs:
echo 'false'
}
echo "::set-output name=linux-x64::$(check_platform linux-x64 linux x64)"
echo "::set-output name=linux-x86::$(check_platform linux-x86 linux x86)"
echo "::set-output name=linux-x64-variants::$(check_platform linux-x64-variants variants)"
echo "::set-output name=linux-cross-compile::$(check_platform linux-cross-compile cross-compile)"
echo "::set-output name=macos-x64::$(check_platform macos-x64 macos x64)"
echo "::set-output name=macos-aarch64::$(check_platform macos-aarch64 macos aarch64)"
echo "::set-output name=windows-x64::$(check_platform windows-x64 windows x64)"
echo "::set-output name=windows-aarch64::$(check_platform windows-aarch64 windows aarch64)"
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
###
### Build jobs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ jobs:
# We need a minimal PATH on Windows
# Set PATH to "", so just GITHUB_PATH is included
if [[ '${{ runner.os }}' == 'Windows' ]]; then
echo "::set-output name=value::"
echo "value=" >> $GITHUB_OUTPUT
else
echo "::set-output name=value::$PATH"
echo "value=$PATH" >> $GITHUB_OUTPUT
fi
- name: 'Run tests'
Expand All @@ -154,7 +154,7 @@ jobs:
SYMBOLS_IMAGE_DIR=${{ steps.bundles.outputs.symbols-path }}
TEST_IMAGE_DIR=${{ steps.bundles.outputs.tests-path }}
JTREG='JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash;VERBOSE=fail,error,time;KEYWORDS=!headful'
&& bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY"
&& bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY" "$GITHUB_OUTPUT"
env:
PATH: ${{ steps.path.outputs.value }}

Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
fi
artifact_name="results-${{ inputs.platform }}-$(echo ${{ matrix.test-name }} | tr '/ ' '__')"
echo "::set-output name=artifact-name::$artifact_name"
echo "artifact-name=$artifact_name" >> $GITHUB_OUTPUT
if: always()

- name: 'Upload test results'
Expand Down

1 comment on commit b35922b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.