diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index a1155b725..6b9774ebf 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -174,6 +174,22 @@ jobs: else echo "matrix={\"mechanical-version\":['${{ needs.revn-variations.outputs.test_docker_image_version }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT fi + container-stability-check: + runs-on: ubuntu-latest + needs: [revn-variations] + outputs: + container_stable_exit: ${{ steps.check_stability.outputs.container_stable_exit }} + steps: + - id: check_stability + run: | + sudo apt update + sudo apt install bc -y + CONTAINER_VERSION=$(echo "${{ needs.revn-variations.outputs.test_docker_image_version }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1) + if (( $(echo "$CONTAINER_VERSION > 24.2" | bc -l) )); then + echo "container_stable_exit=true" >> $GITHUB_OUTPUT + else + echo "container_stable_exit=false" >> $GITHUB_OUTPUT + fi remote-connect: name: Remote connect testing and coverage - Mechanical ${{ matrix.mechanical-version }} @@ -269,7 +285,7 @@ jobs: name: Embedding testing and coverage runs-on: ubuntu-latest timeout-minutes: 10 - needs: [smoke-tests, revn-variations] + needs: [smoke-tests, revn-variations, container-stability-check] container: image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash @@ -304,7 +320,11 @@ jobs: PYTHONUNBUFFERED: 1 run: | . /env/bin/activate - xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" = "true" ]; then + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml + else + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true + fi - name: Upload coverage results uses: actions/upload-artifact@v4 @@ -411,7 +431,7 @@ jobs: container: image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash - needs: [ style, revn-variations] + needs: [ style, revn-variations, container-stability-check] strategy: fail-fast: false matrix: @@ -447,7 +467,11 @@ jobs: unset PYMECHANICAL_PORT unset PYMECHANICAL_START_INSTANCE . /env/bin/activate - pytest -m remote_session_launch -s --junitxml launch_test_results${{ matrix.python-version }}.xml || true + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" = "true" ]; then + pytest -m remote_session_launch -s --junitxml launch_test_results${{ matrix.python-version }}.xml + else + pytest -m remote_session_launch -s --junitxml launch_test_results${{ matrix.python-version }}.xml || true + fi - name: Publish Launch Test Report uses: mikepenz/action-junit-report@v5 @@ -483,7 +507,7 @@ jobs: container: image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash - needs: [style, doc-style, revn-variations] + needs: [style, doc-style, revn-variations, container-stability-check] steps: @@ -545,10 +569,14 @@ jobs: unset PYMECHANICAL_START_INSTANCE output_file=doc_$1_output.txt - xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true - cat $output_file - echo done running make - validate_output $output_file + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" = "true" ]; then + xvfb-run mechanical-env make -C doc $1 + else + xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true + cat $output_file + echo done running make + validate_output $output_file + fi } # Validate that the html or pdf build succeeded diff --git a/doc/changelog.d/965.maintenance.md b/doc/changelog.d/965.maintenance.md new file mode 100644 index 000000000..b238e087b --- /dev/null +++ b/doc/changelog.d/965.maintenance.md @@ -0,0 +1 @@ +Modify how job success is verified for CI/CD \ No newline at end of file