From eef9794d92c5ea9bc3cbc578187ef2114b013cd5 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 7 Jan 2026 11:28:06 +0800 Subject: [PATCH 1/4] Post check_profiles error message to PR --- .github/workflows/check_profiles.yml | 95 +++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check_profiles.yml b/.github/workflows/check_profiles.yml index 2742fa63f0..bc5296083f 100644 --- a/.github/workflows/check_profiles.yml +++ b/.github/workflows/check_profiles.yml @@ -1,8 +1,8 @@ name: Check profiles -on: +on: pull_request: - branches: - - main + branches: + - main paths: - 'resources/profiles/**' - ".github/workflows/check_profiles.yml" @@ -10,7 +10,7 @@ on: workflow_dispatch: inputs: logLevel: - description: 'Log level' + description: 'Log level' required: true default: 'warning' @@ -19,16 +19,26 @@ jobs: check_translation: name: Check profiles runs-on: ubuntu-24.04 - steps: + steps: - name: Checkout repository uses: actions/checkout@v6 - name: Run extra JSON check + id: extra_json_check + continue-on-error: true run: | - python3 ./scripts/orca_extra_profile_check.py + set +e + output=$(python3 ./scripts/orca_extra_profile_check.py 2>&1) + exit_code=$? + echo "$output" + echo "output<> $GITHUB_OUTPUT + echo "$output" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + echo "exit_code=$exit_code" >> $GITHUB_OUTPUT + exit $exit_code # download - - name: Download + - name: Download working-directory: ${{ github.workspace }} run: | curl -LJO https://github.com/SoftFever/Orca_tools/releases/download/1/OrcaSlicer_profile_validator @@ -36,15 +46,82 @@ jobs: # validate profiles - name: validate system profiles + id: validate_system + continue-on-error: true run: | - ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 + set +e + output=$(./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1) + exit_code=$? + echo "$output" + echo "output<> $GITHUB_OUTPUT + echo "$output" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + echo "exit_code=$exit_code" >> $GITHUB_OUTPUT + exit $exit_code - name: validate custom presets + id: validate_custom + continue-on-error: true working-directory: ${{ github.workspace }} run: | + set +e curl -LJO https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip unzip ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles - ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 + output=$(./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1) + exit_code=$? + echo "$output" + echo "output<> $GITHUB_OUTPUT + echo "$output" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + echo "exit_code=$exit_code" >> $GITHUB_OUTPUT + exit $exit_code + + - name: Post error comment on PR + if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }} + uses: actions/github-script@v7 + with: + script: | + let body = '## ❌ Profile Validation Errors\n\n'; + + const extraJsonCheck = '${{ steps.extra_json_check.outcome }}'; + const validateSystem = '${{ steps.validate_system.outcome }}'; + const validateCustom = '${{ steps.validate_custom.outcome }}'; + + if (extraJsonCheck === 'failure') { + body += '### Extra JSON Check Failed\n\n'; + body += '```\n'; + body += `${{ steps.extra_json_check.outputs.output }}`.substring(0, 30000); + body += '\n```\n\n'; + } + + if (validateSystem === 'failure') { + body += '### System Profile Validation Failed\n\n'; + body += '```\n'; + body += `${{ steps.validate_system.outputs.output }}`.substring(0, 30000); + body += '\n```\n\n'; + } + + if (validateCustom === 'failure') { + body += '### Custom Preset Validation Failed\n\n'; + body += '```\n'; + body += `${{ steps.validate_custom.outputs.output }}`.substring(0, 30000); + body += '\n```\n\n'; + } + + body += '---\n*Please fix the above errors and push a new commit.*'; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: body + }); + + - name: Fail if any check failed + if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }} + run: | + echo "One or more profile checks failed. See above for details." + exit 1 From cb786d95a65ac84615bff6cdafca2de7395bbb76 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 7 Jan 2026 11:28:28 +0800 Subject: [PATCH 2/4] test error --- resources/profiles/Voron.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/profiles/Voron.json b/resources/profiles/Voron.json index 213e6dd4ac..d780a93d9f 100644 --- a/resources/profiles/Voron.json +++ b/resources/profiles/Voron.json @@ -6,7 +6,7 @@ "machine_model_list": [ { "name": "Voron 0.1", - "sub_path": "machine/Voron 0.1.json" + "sub_path": "machine/Voron 0..json" }, { "name": "Voron 2.4 250", From 99aef1772308258555858472f3550cabd322b3e6 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 7 Jan 2026 13:55:36 +0800 Subject: [PATCH 3/4] fix --- .github/workflows/check_profiles.yml | 97 ++++++++++++---------------- 1 file changed, 40 insertions(+), 57 deletions(-) diff --git a/.github/workflows/check_profiles.yml b/.github/workflows/check_profiles.yml index bc5296083f..ea27fc754f 100644 --- a/.github/workflows/check_profiles.yml +++ b/.github/workflows/check_profiles.yml @@ -28,14 +28,8 @@ jobs: continue-on-error: true run: | set +e - output=$(python3 ./scripts/orca_extra_profile_check.py 2>&1) - exit_code=$? - echo "$output" - echo "output<> $GITHUB_OUTPUT - echo "$output" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - echo "exit_code=$exit_code" >> $GITHUB_OUTPUT - exit $exit_code + python3 ./scripts/orca_extra_profile_check.py 2>&1 | tee ${{ runner.temp }}/extra_json_check.log + exit ${PIPESTATUS[0]} # download - name: Download @@ -50,14 +44,8 @@ jobs: continue-on-error: true run: | set +e - output=$(./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1) - exit_code=$? - echo "$output" - echo "output<> $GITHUB_OUTPUT - echo "$output" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - echo "exit_code=$exit_code" >> $GITHUB_OUTPUT - exit $exit_code + ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_system.log + exit ${PIPESTATUS[0]} - name: validate custom presets id: validate_custom @@ -67,55 +55,50 @@ jobs: set +e curl -LJO https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip unzip ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles - output=$(./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1) - exit_code=$? - echo "$output" - echo "output<> $GITHUB_OUTPUT - echo "$output" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - echo "exit_code=$exit_code" >> $GITHUB_OUTPUT - exit $exit_code + ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_custom.log + exit ${PIPESTATUS[0]} - name: Post error comment on PR if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }} - uses: actions/github-script@v7 - with: - script: | - let body = '## ❌ Profile Validation Errors\n\n'; + env: + GH_TOKEN: ${{ github.token }} + run: | + { + echo "## :x: Profile Validation Errors" + echo "" - const extraJsonCheck = '${{ steps.extra_json_check.outcome }}'; - const validateSystem = '${{ steps.validate_system.outcome }}'; - const validateCustom = '${{ steps.validate_custom.outcome }}'; + if [ "${{ steps.extra_json_check.outcome }}" = "failure" ]; then + echo "### Extra JSON Check Failed" + echo "" + echo '```' + head -c 30000 ${{ runner.temp }}/extra_json_check.log || echo "No output captured" + echo '```' + echo "" + fi - if (extraJsonCheck === 'failure') { - body += '### Extra JSON Check Failed\n\n'; - body += '```\n'; - body += `${{ steps.extra_json_check.outputs.output }}`.substring(0, 30000); - body += '\n```\n\n'; - } + if [ "${{ steps.validate_system.outcome }}" = "failure" ]; then + echo "### System Profile Validation Failed" + echo "" + echo '```' + head -c 30000 ${{ runner.temp }}/validate_system.log || echo "No output captured" + echo '```' + echo "" + fi - if (validateSystem === 'failure') { - body += '### System Profile Validation Failed\n\n'; - body += '```\n'; - body += `${{ steps.validate_system.outputs.output }}`.substring(0, 30000); - body += '\n```\n\n'; - } + if [ "${{ steps.validate_custom.outcome }}" = "failure" ]; then + echo "### Custom Preset Validation Failed" + echo "" + echo '```' + head -c 30000 ${{ runner.temp }}/validate_custom.log || echo "No output captured" + echo '```' + echo "" + fi - if (validateCustom === 'failure') { - body += '### Custom Preset Validation Failed\n\n'; - body += '```\n'; - body += `${{ steps.validate_custom.outputs.output }}`.substring(0, 30000); - body += '\n```\n\n'; - } + echo "---" + echo "*Please fix the above errors and push a new commit.*" + } > ${{ runner.temp }}/pr_comment.md - body += '---\n*Please fix the above errors and push a new commit.*'; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: body - }); + gh pr comment ${{ github.event.pull_request.number }} --body-file ${{ runner.temp }}/pr_comment.md - name: Fail if any check failed if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }} From fe227b93bb3b6ec214803481bda54838077dd58a Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 7 Jan 2026 13:57:15 +0800 Subject: [PATCH 4/4] Revert "test error" This reverts commit cb786d95a65ac84615bff6cdafca2de7395bbb76. --- resources/profiles/Voron.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/profiles/Voron.json b/resources/profiles/Voron.json index d780a93d9f..213e6dd4ac 100644 --- a/resources/profiles/Voron.json +++ b/resources/profiles/Voron.json @@ -6,7 +6,7 @@ "machine_model_list": [ { "name": "Voron 0.1", - "sub_path": "machine/Voron 0..json" + "sub_path": "machine/Voron 0.1.json" }, { "name": "Voron 2.4 250",