Skip to content

Commit

Permalink
[GA] fail status for example workflow (#3015)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
AlexanderDokuchaev authored Oct 16, 2024
1 parent 03f2422 commit cb0fe0d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand All @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit cb0fe0d

Please sign in to comment.