mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-21 20:25:20 +00:00
fix
This commit is contained in:
97
.github/workflows/check_profiles.yml
vendored
97
.github/workflows/check_profiles.yml
vendored
@@ -28,14 +28,8 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
set +e
|
set +e
|
||||||
output=$(python3 ./scripts/orca_extra_profile_check.py 2>&1)
|
python3 ./scripts/orca_extra_profile_check.py 2>&1 | tee ${{ runner.temp }}/extra_json_check.log
|
||||||
exit_code=$?
|
exit ${PIPESTATUS[0]}
|
||||||
echo "$output"
|
|
||||||
echo "output<<EOF" >> $GITHUB_OUTPUT
|
|
||||||
echo "$output" >> $GITHUB_OUTPUT
|
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
|
||||||
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
|
|
||||||
exit $exit_code
|
|
||||||
|
|
||||||
# download
|
# download
|
||||||
- name: Download
|
- name: Download
|
||||||
@@ -50,14 +44,8 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
set +e
|
set +e
|
||||||
output=$(./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1)
|
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_system.log
|
||||||
exit_code=$?
|
exit ${PIPESTATUS[0]}
|
||||||
echo "$output"
|
|
||||||
echo "output<<EOF" >> $GITHUB_OUTPUT
|
|
||||||
echo "$output" >> $GITHUB_OUTPUT
|
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
|
||||||
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
|
|
||||||
exit $exit_code
|
|
||||||
|
|
||||||
- name: validate custom presets
|
- name: validate custom presets
|
||||||
id: validate_custom
|
id: validate_custom
|
||||||
@@ -67,55 +55,50 @@ jobs:
|
|||||||
set +e
|
set +e
|
||||||
curl -LJO https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip
|
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
|
unzip ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles
|
||||||
output=$(./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1)
|
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_custom.log
|
||||||
exit_code=$?
|
exit ${PIPESTATUS[0]}
|
||||||
echo "$output"
|
|
||||||
echo "output<<EOF" >> $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
|
- 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') }}
|
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
|
env:
|
||||||
with:
|
GH_TOKEN: ${{ github.token }}
|
||||||
script: |
|
run: |
|
||||||
let body = '## ❌ Profile Validation Errors\n\n';
|
{
|
||||||
|
echo "## :x: Profile Validation Errors"
|
||||||
|
echo ""
|
||||||
|
|
||||||
const extraJsonCheck = '${{ steps.extra_json_check.outcome }}';
|
if [ "${{ steps.extra_json_check.outcome }}" = "failure" ]; then
|
||||||
const validateSystem = '${{ steps.validate_system.outcome }}';
|
echo "### Extra JSON Check Failed"
|
||||||
const validateCustom = '${{ steps.validate_custom.outcome }}';
|
echo ""
|
||||||
|
echo '```'
|
||||||
|
head -c 30000 ${{ runner.temp }}/extra_json_check.log || echo "No output captured"
|
||||||
|
echo '```'
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
if (extraJsonCheck === 'failure') {
|
if [ "${{ steps.validate_system.outcome }}" = "failure" ]; then
|
||||||
body += '### Extra JSON Check Failed\n\n';
|
echo "### System Profile Validation Failed"
|
||||||
body += '```\n';
|
echo ""
|
||||||
body += `${{ steps.extra_json_check.outputs.output }}`.substring(0, 30000);
|
echo '```'
|
||||||
body += '\n```\n\n';
|
head -c 30000 ${{ runner.temp }}/validate_system.log || echo "No output captured"
|
||||||
}
|
echo '```'
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
if (validateSystem === 'failure') {
|
if [ "${{ steps.validate_custom.outcome }}" = "failure" ]; then
|
||||||
body += '### System Profile Validation Failed\n\n';
|
echo "### Custom Preset Validation Failed"
|
||||||
body += '```\n';
|
echo ""
|
||||||
body += `${{ steps.validate_system.outputs.output }}`.substring(0, 30000);
|
echo '```'
|
||||||
body += '\n```\n\n';
|
head -c 30000 ${{ runner.temp }}/validate_custom.log || echo "No output captured"
|
||||||
}
|
echo '```'
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
if (validateCustom === 'failure') {
|
echo "---"
|
||||||
body += '### Custom Preset Validation Failed\n\n';
|
echo "*Please fix the above errors and push a new commit.*"
|
||||||
body += '```\n';
|
} > ${{ runner.temp }}/pr_comment.md
|
||||||
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.*';
|
gh pr comment ${{ github.event.pull_request.number }} --body-file ${{ runner.temp }}/pr_comment.md
|
||||||
|
|
||||||
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
|
- name: Fail if any check failed
|
||||||
if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user