|
| 1 | +name: Test examples |
| 2 | +permissions: read-all |
| 3 | + |
| 4 | +on: |
| 5 | + schedule: |
| 6 | + - cron: '0 0 * * *' |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + pull_request_number: |
| 10 | + description: 'The pull request number' |
| 11 | + default: '' |
| 12 | + pytest_args: |
| 13 | + description: 'Pytest arguments' |
| 14 | + default: '' |
| 15 | + |
| 16 | +jobs: |
| 17 | + examples-cpu: |
| 18 | + name: Test exmaples CPU [${{ matrix.group }}/4] |
| 19 | + runs-on: ubuntu-22.04-16-cores |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + group: [1, 2, 3, 4] |
| 24 | + defaults: |
| 25 | + run: |
| 26 | + shell: bash |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 |
| 29 | + with: |
| 30 | + lfs: true |
| 31 | + fetch-depth: 0 # Fetch full history to allow checking out any branch or PR |
| 32 | + - name: Fetch and Checkout the Pull Request Branch |
| 33 | + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }} |
| 34 | + run: | |
| 35 | + git fetch origin pull/${{ github.event.inputs.pull_request_number }}/head:pr-${{ github.event.inputs.pull_request_number }} |
| 36 | + git checkout pr-${{ github.event.inputs.pull_request_number }} |
| 37 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 38 | + with: |
| 39 | + python-version: 3.10.14 |
| 40 | + cache: pip |
| 41 | + - name: cpuinfo |
| 42 | + run: cat /proc/cpuinfo |
| 43 | + - name: Install NNCF and test requirements |
| 44 | + run: | |
| 45 | + pip install -e . |
| 46 | + pip install -r tests/cross_fw/examples/requirements.txt |
| 47 | + - name: Print installed modules |
| 48 | + run: pip list |
| 49 | + - name: Run examples test scope |
| 50 | + run: | |
| 51 | + python -m pytest -ras tests/cross_fw/examples \ |
| 52 | + --junit-xml=pytest-results-${{ matrix.group }}.xml \ |
| 53 | + --durations-path=tests/cross_fw/examples/.test_durations \ |
| 54 | + --splitting-algorithm=least_duration \ |
| 55 | + --splits 4 \ |
| 56 | + --group ${{ matrix.group }} \ |
| 57 | + ${{ github.event.inputs.pytest_args || '' }} |
| 58 | + env: |
| 59 | + TQDM_DISABLE: 1 |
| 60 | + - name: Upload artifact |
| 61 | + uses: actions/upload-artifact@v4 |
| 62 | + if: ${{ !cancelled() }} |
| 63 | + with: |
| 64 | + name: pytest-results-${{ matrix.group }} |
| 65 | + path: pytest-results-${{ matrix.group }}.xml |
| 66 | + overwrite: True |
0 commit comments