diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb1462e..4f7a40b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,15 @@ jobs: reference-files-format: csv reference-files-delimiter: . GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Test openmodelica-library-testing + shell: bash + run: | + echo "simulation-tests-passing: ${{ steps.check_results.outputs.simulation-tests-passing }}" + echo "verification-tests-passing: ${{ steps.check_results.outputs.verification-tests-passing }}" + + if [${{ steps.check_results.outputs.simulation-tests-passing }}] && [ ${{ steps.check_results.outputs.n-simulation-passing }} == 2 ] && [${{ steps.check_results.outputs.verification-tests-passing }}] && ! [ ${{ steps.check_results.outputs.n-simulation-passing }} == 1 ]; then + exit 0; + else + exit 1; + fi diff --git a/README.md b/README.md index f1ec0f0..7492e92 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Version of OpenModelica to use for testing. Check [AnHeuermann/setup-openmodelica](https://github.com/AnHeuermann/setup-openmodelica#available-openmodelica-versions) for available versions.\ -Default: `'stable` +Default: `'stable'` ### `reference-files-dir` @@ -84,10 +84,18 @@ jobs: True if all simulation tests are passing. +## ` n-simulation-passing` + +Number of successful simulation tests. + ## `verification-tests-passing` True if all verification tests are passing. +## `n-verification-passing` + +Number of successful verification tests. + ## Artifacts ### HTML Results diff --git a/action.yml b/action.yml index 64c807f..10dae6f 100644 --- a/action.yml +++ b/action.yml @@ -42,9 +42,15 @@ outputs: simulation-tests-passing: description: 'True if all simulation tests are passing' value: ${{ steps.check_results.outputs.simulation-tests-passing }} + n-simulation-passing: + description: 'Number of successful simulation tests' + value: ${{ steps.check_results.outputs.n-simulation-passing }} verification-tests-passing: description: 'True if all verification tests are passing' value: ${{ steps.check_results.outputs.verification-tests-passing }} + n-verification-passing: + description: 'Number of successful verification tests' + value: ${{ steps.check_results.outputs.n-verification-passing }} runs: using: "composite" diff --git a/scripts/checkTestResults.py b/scripts/checkTestResults.py index 25b02a5..a6bd4ae 100755 --- a/scripts/checkTestResults.py +++ b/scripts/checkTestResults.py @@ -33,7 +33,9 @@ def getTestResults(htmlFile, testVerification): output_file = os.getenv('GITHUB_OUTPUT') with open(output_file, "a") as f: f.write(f"simulation-tests-passing={simSuccess}\n") + f.write(f"n-simulation-passing={overview['Simulation'][0]}\n") f.write(f"verification-tests-passing={testVerification and not verificationSuccess}") + f.write(f"n-verification-passing={overview['Verification'][0]}") return 0