Skip to content

Commit

Permalink
Update regression-report.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
relentless-pursuit authored Jan 20, 2025
1 parent 251d7fb commit 5b44b1f
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions .github/workflows/regression-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,57 +398,57 @@ jobs:
if: needs.handle_existing_config_bundle.result == 'success'
|| needs.handle_configs_in_pr_description.result == 'success'
env:
DIFF_CONFIG_LINK: ${{
needs.handle_existing_config_bundle.outputs.config_link
|| needs.handle_configs_in_pr_description.outputs.config_link
}}
PATCH_CONFIG_LINK: ${{
needs.handle_configs_in_pr_description.outputs.patch_config_link
|| ''
}}
NEW_MODULE_CONFIG_LINK: ${{
needs.handle_configs_in_pr_description.outputs.new_module_config_link
|| ''
}}
DIFF_PROJECTS_LINK: ${{
needs.handle_existing_config_bundle.outputs.projects_link
|| needs.handle_configs_in_pr_description.outputs.projects_link
|| env.DEFAULT_PROJECTS_LINK
}}
DIFF_CONFIG_LINK: >-
${{ needs.handle_existing_config_bundle.outputs.config_link
|| needs.handle_configs_in_pr_description.outputs.config_link }}
PATCH_CONFIG_LINK: >-
${{ needs.handle_configs_in_pr_description.outputs.patch_config_link || '' }}
NEW_MODULE_CONFIG_LINK: >-
${{ needs.handle_configs_in_pr_description.outputs.new_module_config_link || '' }}
DIFF_PROJECTS_LINK: >-
${{ needs.handle_existing_config_bundle.outputs.projects_link
|| needs.handle_configs_in_pr_description.outputs.projects_link
|| env.DEFAULT_PROJECTS_LINK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FOLDER: ${{ github.workspace }}/.ci-temp/config
run: |
mkdir -p .ci-temp
mkdir -p "$CONFIG_FOLDER"
# Download main config files
# Download main config files (config.xml, list-of-projects.*)
if ! ./.ci/diff-report.sh download-files; then
./.ci/append-to-github-output.sh "failed" "true"
exit 1
fi
# Handle additional configuration files
- name: Attempt to download extra files (e.g. java.header)
if: always()
run: |
# Only try if we actually found diff_config.xml
if [ -f ".ci-temp/diff_config.xml" ]; then
# Try to download java.header
if curl --fail-with-body -s -L -o "$CONFIG_FOLDER/java.header" \
"https://raw.githubusercontent.com/checkstyle/test-configs/refs/heads/main/Header/Example2/config.xml"; then
echo "Successfully downloaded java.header"
else
echo "Failed to download java.header, continuing workflow"
fi
# The environment variable DIFF_CONFIG_LINK points to, for example:
# https://raw.githubusercontent.com/checkstyle/test-configs/main/Header/Example2/config.xml
# We want to remove the "/config.xml" part so we can get:
# https://raw.githubusercontent.com/checkstyle/test-configs/main/Header/Example2
CONFIG_FOLDER_URL="${DIFF_CONFIG_LINK%/*}"
# Try to download extended-config.xml
if curl --fail-with-body -s -L -o "$CONFIG_FOLDER/extended-config.xml" \
"https://raw.githubusercontent.com/checkstyle/test-configs/main/Header/Example2/extended-config.xml"; then
echo "Successfully downloaded extended-config.xml"
echo "Attempting to download 'java.header' from ${CONFIG_FOLDER_URL}/java.header ..."
curl -fSLo ".ci-temp/config/java.header" \
"${CONFIG_FOLDER_URL}/java.header" \
|| echo "No 'java.header' found there—skipping."

# Print the contents if the download succeeded
if [ -f ".ci-temp/config/java.header" ]; then
echo "Contents of .ci-temp/config/java.header:"
cat .ci-temp/config/java.header
else
echo "Failed to download extended-config.xml, continuing workflow"
echo "No .ci-temp/config/java.header file to show."
fi
fi

# Verify downloaded files for debugging
echo "Contents of CONFIG_FOLDER:"
ls -la "$CONFIG_FOLDER"
else
echo "No diff_config.xml found, skipping extra-file download."
fi

- name: Cache config files
uses: actions/cache@v4
Expand Down

0 comments on commit 5b44b1f

Please # to comment.