mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 12:00:17 +02:00
Merge pull request #3149 from Sonicadvance1/fail_on_change
InstCountCI: Fail CI if there was any difference.
This commit is contained in:
2 files changed
+30
-4
No files matched your search
@@ -86,6 +86,25 @@ jobs:
|
|||||||
working-directory: ${{runner.workspace}}/build
|
working-directory: ${{runner.workspace}}/build
|
||||||
run: mv ${{runner.workspace}}/build/Testing/Temporary/LastTest.log ${{runner.workspace}}/build/Testing/Temporary/LastTest_InstCountCI.log || true
|
run: mv ${{runner.workspace}}/build/Testing/Temporary/LastTest.log ${{runner.workspace}}/build/Testing/Temporary/LastTest_InstCountCI.log || true
|
||||||
|
|
||||||
|
- name: Update local repo instcount
|
||||||
|
if: ${{ always() }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{runner.workspace}}/build
|
||||||
|
run: cmake --build . --config $BUILD_TYPE --target instcountci_update_tests
|
||||||
|
|
||||||
|
- name: Get instcountCI diff
|
||||||
|
if: ${{ always() }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{github.workspace}}/
|
||||||
|
run: git diff --output=${{runner.workspace}}/build/InstCountCI.diff
|
||||||
|
|
||||||
|
- name: Check if InstCountCI Diff exists
|
||||||
|
if: ${{ always() }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{github.workspace}}/
|
||||||
|
# Check if the file is empty
|
||||||
|
run: sh -c "! test -s ${{runner.workspace}}/build/InstCountCI.diff"
|
||||||
|
|
||||||
- name: Truncate test results
|
- name: Truncate test results
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -107,3 +126,12 @@ jobs:
|
|||||||
path: ${{runner.workspace}}/build/Testing/Temporary/LastTest_*.log
|
path: ${{runner.workspace}}/build/Testing/Temporary/LastTest_*.log
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
|
||||||
|
- name: Upload results InstCountCI
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: 'actions/upload-artifact@v3'
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
name: Results-${{ env.runner_name }}-instcountci
|
||||||
|
path: ${{runner.workspace}}/build/InstCountCI.diff
|
||||||
|
retention-days: 3
|
||||||
|
|
||||||
@@ -286,10 +286,8 @@ static bool TestInstructions(FEXCore::Context::Context *CTX, FEXCore::Core::Inte
|
|||||||
LogMan::Msg::EFmt("Fail: '{}': {} host instructions", CurrentTest->TestInst, INSTStats->first.HostCodeInstructions);
|
LogMan::Msg::EFmt("Fail: '{}': {} host instructions", CurrentTest->TestInst, INSTStats->first.HostCodeInstructions);
|
||||||
LogMan::Msg::EFmt("Fail: Test took {} instructions but we expected {} instructions!", INSTStats->first.HostCodeInstructions, CurrentTest->ExpectedInstructionCount);
|
LogMan::Msg::EFmt("Fail: Test took {} instructions but we expected {} instructions!", INSTStats->first.HostCodeInstructions, CurrentTest->ExpectedInstructionCount);
|
||||||
|
|
||||||
if (CurrentTest->Optimal) {
|
// Fail the test if the instruction count has changed at all.
|
||||||
// Don't count the test as a failure if it's known non-optimal.
|
TestsPassed = false;
|
||||||
TestsPassed = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go to the next test.
|
// Go to the next test.
|
||||||
|
|||||||
Reference in new issue
Block a user