From cb0fe0dcc986a3d70c1bdbcfab6768205c6123bf Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Wed, 16 Oct 2024 07:54:57 +0300 Subject: [PATCH] [GA] fail status for example workflow (#3015) ### Changes - Use `if: ${{ !cancelled() }}` to upload artifact for failed job - Make possible manually run workflow on branch ### Reason for changes `continue-on-error: true` is make failed job green. --- .github/workflows/examples.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 9c7439a74b4..150ec493839 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -8,12 +8,10 @@ on: inputs: pull_request_number: description: 'The pull request number' - required: true - type: number + default: '' pytest_args: description: 'Pytest arguments' default: '' - type: string jobs: examples-cpu: @@ -32,7 +30,7 @@ jobs: lfs: true fetch-depth: 0 # Fetch full history to allow checking out any branch or PR - name: Fetch and Checkout the Pull Request Branch - if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }} run: | git fetch origin pull/${{ github.event.inputs.pull_request_number }}/head:pr-${{ github.event.inputs.pull_request_number }} git checkout pr-${{ github.event.inputs.pull_request_number }} @@ -49,7 +47,6 @@ jobs: - name: Print installed modules run: pip list - name: Run examples test scope - continue-on-error: true run: | python -m pytest -ras tests/cross_fw/examples \ --junit-xml=pytest-results-${{ matrix.group }}.xml \ @@ -62,6 +59,7 @@ jobs: TQDM_DISABLE: 1 - name: Upload artifact uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} with: name: pytest-results-${{ matrix.group }} path: pytest-results-${{ matrix.group }}.xml